codex 1.6.18__py3-none-any.whl → 1.7.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of codex might be problematic. Click here for more details.
- codex/choices.py +419 -0
- codex/choices_to_json.py +122 -0
- codex/db.py +134 -0
- codex/exceptions.py +2 -3
- codex/librarian/bookmark/__init__.py +1 -0
- codex/librarian/bookmark/bookmarkd.py +38 -0
- codex/librarian/bookmark/tasks.py +19 -0
- codex/librarian/bookmark/update.py +154 -0
- codex/librarian/covers/coverd.py +3 -4
- codex/librarian/covers/create.py +8 -7
- codex/librarian/covers/path.py +1 -2
- codex/librarian/covers/purge.py +3 -3
- codex/librarian/importer/const.py +7 -1
- codex/librarian/importer/create_fks.py +5 -2
- codex/librarian/importer/importerd.py +17 -12
- codex/librarian/importer/moved.py +44 -13
- codex/librarian/importer/tasks.py +2 -0
- codex/librarian/janitor/cleanup.py +21 -8
- codex/librarian/janitor/integrity.py +371 -0
- codex/librarian/janitor/janitor.py +50 -15
- codex/librarian/janitor/latest_version.py +2 -1
- codex/librarian/janitor/status.py +5 -0
- codex/librarian/janitor/tasks.py +37 -0
- codex/librarian/janitor/update.py +1 -1
- codex/librarian/librariand.py +37 -24
- codex/librarian/search/optimize.py +43 -0
- codex/librarian/search/remove.py +18 -46
- codex/librarian/search/searchd.py +14 -17
- codex/librarian/search/status.py +2 -1
- codex/librarian/search/tasks.py +4 -9
- codex/librarian/search/update.py +223 -301
- codex/librarian/watchdog/emitter.py +21 -19
- codex/librarian/watchdog/event_batcherd.py +0 -1
- codex/librarian/watchdog/events.py +4 -1
- codex/librarian/watchdog/observers.py +2 -1
- codex/migrations/0029_comicfts.py +58 -0
- codex/migrations/0030_nocase_collation_day_month_indexes_status_types.py +202 -0
- codex/models/admin.py +15 -11
- codex/models/base.py +9 -0
- codex/models/bookmark.py +3 -3
- codex/models/comic.py +68 -16
- codex/models/functions.py +60 -2
- codex/models/groups.py +6 -1
- codex/models/library.py +1 -3
- codex/models/paths.py +9 -3
- codex/models/query.py +6 -0
- codex/run.py +11 -9
- codex/serializers/admin/tasks.py +2 -2
- codex/serializers/browser/mixins.py +18 -14
- codex/serializers/browser/page.py +2 -0
- codex/serializers/browser/settings.py +4 -4
- codex/serializers/fields.py +9 -5
- codex/settings/settings.py +16 -17
- codex/signals/django_signals.py +4 -10
- codex/startup.py +7 -39
- codex/static_root/assets/VCheckbox-D_CWEmqR.84f2b49311e8.js +1 -0
- codex/static_root/assets/VCheckbox-D_CWEmqR.84f2b49311e8.js.br +0 -0
- codex/static_root/assets/VCheckbox-D_CWEmqR.84f2b49311e8.js.gz +0 -0
- codex/static_root/assets/VCheckbox-D_CWEmqR.js +1 -0
- codex/static_root/assets/VCheckbox-D_CWEmqR.js.br +0 -0
- codex/static_root/assets/VCheckbox-D_CWEmqR.js.gz +0 -0
- codex/static_root/assets/VCheckboxBtn-B1BhcFvi.0eaf3c516474.js +1 -0
- codex/static_root/assets/VCheckboxBtn-B1BhcFvi.0eaf3c516474.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-B1BhcFvi.0eaf3c516474.js.gz +0 -0
- codex/static_root/assets/VCheckboxBtn-B1BhcFvi.js +1 -0
- codex/static_root/assets/VCheckboxBtn-B1BhcFvi.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-B1BhcFvi.js.gz +0 -0
- codex/static_root/assets/VCombobox-CZAW6_3Q.0e2401e819a5.js +1 -0
- codex/static_root/assets/VCombobox-CZAW6_3Q.0e2401e819a5.js.br +0 -0
- codex/static_root/assets/VCombobox-CZAW6_3Q.0e2401e819a5.js.gz +0 -0
- codex/static_root/assets/VCombobox-CZAW6_3Q.js +1 -0
- codex/static_root/assets/VCombobox-CZAW6_3Q.js.br +0 -0
- codex/static_root/assets/VCombobox-CZAW6_3Q.js.gz +0 -0
- codex/static_root/assets/VDialog-CSHgHIlG.a0bcd336cb7b.js +1 -0
- codex/static_root/assets/VDialog-CSHgHIlG.a0bcd336cb7b.js.br +0 -0
- codex/static_root/assets/VDialog-CSHgHIlG.a0bcd336cb7b.js.gz +0 -0
- codex/static_root/assets/VDialog-CSHgHIlG.js +1 -0
- codex/static_root/assets/VDialog-CSHgHIlG.js.br +0 -0
- codex/static_root/assets/VDialog-CSHgHIlG.js.gz +0 -0
- codex/static_root/assets/VDialog-CSvrKKb2.css +1 -0
- codex/static_root/assets/VDialog-CSvrKKb2.css.br +0 -0
- codex/static_root/assets/VDialog-CSvrKKb2.css.gz +0 -0
- codex/static_root/assets/VDialog-CSvrKKb2.fd4d50904b17.css +1 -0
- codex/static_root/assets/VDialog-CSvrKKb2.fd4d50904b17.css.br +0 -0
- codex/static_root/assets/VDialog-CSvrKKb2.fd4d50904b17.css.gz +0 -0
- codex/static_root/assets/VExpansionPanels-CG6MpdMC.e96ae8afad97.js +1 -0
- codex/static_root/assets/VExpansionPanels-CG6MpdMC.e96ae8afad97.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-CG6MpdMC.e96ae8afad97.js.gz +0 -0
- codex/static_root/assets/VExpansionPanels-CG6MpdMC.js +1 -0
- codex/static_root/assets/VExpansionPanels-CG6MpdMC.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-CG6MpdMC.js.gz +0 -0
- codex/static_root/assets/VRadioGroup-CAgQxkiU.f26ecb0c3e34.js +1 -0
- codex/static_root/assets/VRadioGroup-CAgQxkiU.f26ecb0c3e34.js.br +0 -0
- codex/static_root/assets/VRadioGroup-CAgQxkiU.f26ecb0c3e34.js.gz +0 -0
- codex/static_root/assets/VRadioGroup-CAgQxkiU.js +1 -0
- codex/static_root/assets/VRadioGroup-CAgQxkiU.js.br +0 -0
- codex/static_root/assets/VRadioGroup-CAgQxkiU.js.gz +0 -0
- codex/static_root/assets/VSelect-C1gez8rl.9b11d2f00faf.js +1 -0
- codex/static_root/assets/VSelect-C1gez8rl.9b11d2f00faf.js.br +0 -0
- codex/static_root/assets/VSelect-C1gez8rl.9b11d2f00faf.js.gz +0 -0
- codex/static_root/assets/VSelect-C1gez8rl.js +1 -0
- codex/static_root/assets/VSelect-C1gez8rl.js.br +0 -0
- codex/static_root/assets/VSelect-C1gez8rl.js.gz +0 -0
- codex/static_root/assets/VSelect-DLu8bpcs.98bdcf35411c.css +1 -0
- codex/static_root/assets/VSelect-DLu8bpcs.98bdcf35411c.css.br +0 -0
- codex/static_root/assets/VSelect-DLu8bpcs.98bdcf35411c.css.gz +0 -0
- codex/static_root/assets/VSelect-DLu8bpcs.css +1 -0
- codex/static_root/assets/VSelect-DLu8bpcs.css.br +0 -0
- codex/static_root/assets/VSelect-DLu8bpcs.css.gz +0 -0
- codex/static_root/assets/VSelectionControl-DBqDlKjK.160beaa1b56c.js +1 -0
- codex/static_root/assets/VSelectionControl-DBqDlKjK.160beaa1b56c.js.br +0 -0
- codex/static_root/assets/VSelectionControl-DBqDlKjK.160beaa1b56c.js.gz +0 -0
- codex/static_root/assets/VSelectionControl-DBqDlKjK.js +1 -0
- codex/static_root/assets/VSelectionControl-DBqDlKjK.js.br +0 -0
- codex/static_root/assets/VSelectionControl-DBqDlKjK.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-BtXPhMOT.830f136ffd41.css +1 -0
- codex/static_root/assets/VSlideGroup-BtXPhMOT.830f136ffd41.css.br +0 -0
- codex/static_root/assets/VSlideGroup-BtXPhMOT.830f136ffd41.css.gz +0 -0
- codex/static_root/assets/VSlideGroup-BtXPhMOT.css +1 -0
- codex/static_root/assets/VSlideGroup-BtXPhMOT.css.br +0 -0
- codex/static_root/assets/VSlideGroup-BtXPhMOT.css.gz +0 -0
- codex/static_root/assets/VSlideGroup-SqR_NAL1.40ba1d838a6e.js +1 -0
- codex/static_root/assets/VSlideGroup-SqR_NAL1.40ba1d838a6e.js.br +0 -0
- codex/static_root/assets/VSlideGroup-SqR_NAL1.40ba1d838a6e.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-SqR_NAL1.js +1 -0
- codex/static_root/assets/VSlideGroup-SqR_NAL1.js.br +0 -0
- codex/static_root/assets/VSlideGroup-SqR_NAL1.js.gz +0 -0
- codex/static_root/assets/VTable-CYC-wMpk.8f15d66044da.js +1 -0
- codex/static_root/assets/VTable-CYC-wMpk.8f15d66044da.js.br +0 -0
- codex/static_root/assets/VTable-CYC-wMpk.8f15d66044da.js.gz +0 -0
- codex/static_root/assets/VTable-CYC-wMpk.js +1 -0
- codex/static_root/assets/VTable-CYC-wMpk.js.br +0 -0
- codex/static_root/assets/VTable-CYC-wMpk.js.gz +0 -0
- codex/static_root/assets/VTextField-BnCEPZIq.b0c32b2c0b14.css +1 -0
- codex/static_root/assets/VTextField-BnCEPZIq.b0c32b2c0b14.css.br +0 -0
- codex/static_root/assets/VTextField-BnCEPZIq.b0c32b2c0b14.css.gz +0 -0
- codex/static_root/assets/VTextField-BnCEPZIq.css +1 -0
- codex/static_root/assets/VTextField-BnCEPZIq.css.br +0 -0
- codex/static_root/assets/VTextField-BnCEPZIq.css.gz +0 -0
- codex/static_root/assets/VTextField-DMRKRbbT.911ac84d8c9d.js +1 -0
- codex/static_root/assets/VTextField-DMRKRbbT.911ac84d8c9d.js.br +0 -0
- codex/static_root/assets/VTextField-DMRKRbbT.911ac84d8c9d.js.gz +0 -0
- codex/static_root/assets/VTextField-DMRKRbbT.js +1 -0
- codex/static_root/assets/VTextField-DMRKRbbT.js.br +0 -0
- codex/static_root/assets/VTextField-DMRKRbbT.js.gz +0 -0
- codex/static_root/assets/VWindowItem-D0P2xNJl.6a10e3f3a153.js +1 -0
- codex/static_root/assets/VWindowItem-D0P2xNJl.6a10e3f3a153.js.br +0 -0
- codex/static_root/assets/VWindowItem-D0P2xNJl.6a10e3f3a153.js.gz +0 -0
- codex/static_root/assets/VWindowItem-D0P2xNJl.js +1 -0
- codex/static_root/assets/VWindowItem-D0P2xNJl.js.br +0 -0
- codex/static_root/assets/VWindowItem-D0P2xNJl.js.gz +0 -0
- codex/static_root/assets/admin-CD90VMen.4c2b6f2a5111.js +1 -0
- codex/static_root/assets/admin-CD90VMen.4c2b6f2a5111.js.br +0 -0
- codex/static_root/assets/admin-CD90VMen.4c2b6f2a5111.js.gz +0 -0
- codex/static_root/assets/admin-CD90VMen.js +1 -0
- codex/static_root/assets/admin-CD90VMen.js.br +0 -0
- codex/static_root/assets/admin-CD90VMen.js.gz +0 -0
- codex/static_root/assets/{admin-CWEjaFr5.7d4523387384.css → admin-DJ7pIXDQ.css} +1 -1
- codex/static_root/assets/admin-DJ7pIXDQ.css.br +0 -0
- codex/static_root/assets/admin-DJ7pIXDQ.css.gz +0 -0
- codex/static_root/assets/{admin-CWEjaFr5.css → admin-DJ7pIXDQ.e2a77af73ef2.css} +1 -1
- codex/static_root/assets/admin-DJ7pIXDQ.e2a77af73ef2.css.br +0 -0
- codex/static_root/assets/admin-DJ7pIXDQ.e2a77af73ef2.css.gz +0 -0
- codex/static_root/assets/admin-menu-B9bzD6hV.c13b7df2ff57.css +1 -0
- codex/static_root/assets/admin-menu-B9bzD6hV.c13b7df2ff57.css.br +0 -0
- codex/static_root/assets/admin-menu-B9bzD6hV.c13b7df2ff57.css.gz +0 -0
- codex/static_root/assets/admin-menu-B9bzD6hV.css +1 -0
- codex/static_root/assets/admin-menu-B9bzD6hV.css.br +0 -0
- codex/static_root/assets/admin-menu-B9bzD6hV.css.gz +0 -0
- codex/static_root/assets/admin-menu-BpEPGKr_.c9f9178c5a82.js +1 -0
- codex/static_root/assets/admin-menu-BpEPGKr_.c9f9178c5a82.js.br +0 -0
- codex/static_root/assets/admin-menu-BpEPGKr_.c9f9178c5a82.js.gz +0 -0
- codex/static_root/assets/admin-menu-BpEPGKr_.js +1 -0
- codex/static_root/assets/admin-menu-BpEPGKr_.js.br +0 -0
- codex/static_root/assets/admin-menu-BpEPGKr_.js.gz +0 -0
- codex/static_root/assets/admin-settings-button-progress-DDF4rY07.4f1158b650ab.js +1 -0
- codex/static_root/assets/admin-settings-button-progress-DDF4rY07.4f1158b650ab.js.br +0 -0
- codex/static_root/assets/admin-settings-button-progress-DDF4rY07.4f1158b650ab.js.gz +0 -0
- codex/static_root/assets/admin-settings-button-progress-DDF4rY07.js +1 -0
- codex/static_root/assets/admin-settings-button-progress-DDF4rY07.js.br +0 -0
- codex/static_root/assets/admin-settings-button-progress-DDF4rY07.js.gz +0 -0
- codex/static_root/assets/admin-settings-button-progress-DUUQfVsZ.2548c49a853e.css +1 -0
- codex/static_root/assets/admin-settings-button-progress-DUUQfVsZ.css +1 -0
- codex/static_root/assets/browser-C0KS3g2E.0bf1c9c6319c.js +1 -0
- codex/static_root/assets/browser-C0KS3g2E.0bf1c9c6319c.js.br +0 -0
- codex/static_root/assets/browser-C0KS3g2E.0bf1c9c6319c.js.gz +0 -0
- codex/static_root/assets/browser-C0KS3g2E.js +1 -0
- codex/static_root/assets/browser-C0KS3g2E.js.br +0 -0
- codex/static_root/assets/browser-C0KS3g2E.js.gz +0 -0
- codex/static_root/assets/browser-JFL2hLjt.21cb2f7335f7.css +1 -0
- codex/static_root/assets/browser-JFL2hLjt.21cb2f7335f7.css.br +0 -0
- codex/static_root/assets/browser-JFL2hLjt.21cb2f7335f7.css.gz +0 -0
- codex/static_root/assets/browser-JFL2hLjt.css +1 -0
- codex/static_root/assets/browser-JFL2hLjt.css.br +0 -0
- codex/static_root/assets/browser-JFL2hLjt.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-DXJalgW4.a9f34729599d.js +1 -0
- codex/static_root/assets/change-password-dialog-DXJalgW4.a9f34729599d.js.br +0 -0
- codex/static_root/assets/change-password-dialog-DXJalgW4.a9f34729599d.js.gz +0 -0
- codex/static_root/assets/change-password-dialog-DXJalgW4.js +1 -0
- codex/static_root/assets/change-password-dialog-DXJalgW4.js.br +0 -0
- codex/static_root/assets/change-password-dialog-DXJalgW4.js.gz +0 -0
- codex/static_root/assets/change-password-dialog-DrIXdKUC.217574b45b02.css +1 -0
- codex/static_root/assets/change-password-dialog-DrIXdKUC.217574b45b02.css.br +0 -0
- codex/static_root/assets/change-password-dialog-DrIXdKUC.217574b45b02.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-DrIXdKUC.css +1 -0
- codex/static_root/assets/change-password-dialog-DrIXdKUC.css.br +0 -0
- codex/static_root/assets/change-password-dialog-DrIXdKUC.css.gz +0 -0
- codex/static_root/assets/confirm-dialog-B7w6z2rf.472011c06253.css +1 -0
- codex/static_root/assets/confirm-dialog-B7w6z2rf.css +1 -0
- codex/static_root/assets/confirm-dialog-CqDEpU9k.e1811488121d.js +1 -0
- codex/static_root/assets/confirm-dialog-CqDEpU9k.e1811488121d.js.br +0 -0
- codex/static_root/assets/confirm-dialog-CqDEpU9k.e1811488121d.js.gz +0 -0
- codex/static_root/assets/confirm-dialog-CqDEpU9k.js +1 -0
- codex/static_root/assets/confirm-dialog-CqDEpU9k.js.br +0 -0
- codex/static_root/assets/confirm-dialog-CqDEpU9k.js.gz +0 -0
- codex/static_root/assets/datetime-column-UxNaJr8b.c06a11531af3.js +1 -0
- codex/static_root/assets/datetime-column-UxNaJr8b.c06a11531af3.js.br +0 -0
- codex/static_root/assets/datetime-column-UxNaJr8b.c06a11531af3.js.gz +0 -0
- codex/static_root/assets/datetime-column-UxNaJr8b.js +1 -0
- codex/static_root/assets/datetime-column-UxNaJr8b.js.br +0 -0
- codex/static_root/assets/datetime-column-UxNaJr8b.js.gz +0 -0
- codex/static_root/assets/filter-DskcqZHA.e707b5a05b4b.js +1 -0
- codex/static_root/assets/filter-DskcqZHA.e707b5a05b4b.js.br +0 -0
- codex/static_root/assets/filter-DskcqZHA.e707b5a05b4b.js.gz +0 -0
- codex/static_root/assets/filter-DskcqZHA.js +1 -0
- codex/static_root/assets/filter-DskcqZHA.js.br +0 -0
- codex/static_root/assets/filter-DskcqZHA.js.gz +0 -0
- codex/static_root/assets/flag-tab-CqWovuBu.4dfc6b251e85.css +1 -0
- codex/static_root/assets/flag-tab-CqWovuBu.4dfc6b251e85.css.br +0 -0
- codex/static_root/assets/flag-tab-CqWovuBu.4dfc6b251e85.css.gz +0 -0
- codex/static_root/assets/flag-tab-CqWovuBu.css +1 -0
- codex/static_root/assets/flag-tab-CqWovuBu.css.br +0 -0
- codex/static_root/assets/flag-tab-CqWovuBu.css.gz +0 -0
- codex/static_root/assets/flag-tab-xBeWEQ0w.582e77d9e885.js +1 -0
- codex/static_root/assets/flag-tab-xBeWEQ0w.582e77d9e885.js.br +0 -0
- codex/static_root/assets/flag-tab-xBeWEQ0w.582e77d9e885.js.gz +0 -0
- codex/static_root/assets/flag-tab-xBeWEQ0w.js +1 -0
- codex/static_root/assets/flag-tab-xBeWEQ0w.js.br +0 -0
- codex/static_root/assets/flag-tab-xBeWEQ0w.js.gz +0 -0
- codex/static_root/assets/group-tab-Czt2x61x.56e2886b1bac.js +1 -0
- codex/static_root/assets/group-tab-Czt2x61x.56e2886b1bac.js.br +0 -0
- codex/static_root/assets/group-tab-Czt2x61x.56e2886b1bac.js.gz +0 -0
- codex/static_root/assets/group-tab-Czt2x61x.js +1 -0
- codex/static_root/assets/group-tab-Czt2x61x.js.br +0 -0
- codex/static_root/assets/group-tab-Czt2x61x.js.gz +0 -0
- codex/static_root/assets/group-tab-DkIN1Heu.948e907b1e6b.css +1 -0
- codex/static_root/assets/group-tab-DkIN1Heu.948e907b1e6b.css.br +0 -0
- codex/static_root/assets/group-tab-DkIN1Heu.948e907b1e6b.css.gz +0 -0
- codex/static_root/assets/group-tab-DkIN1Heu.css +1 -0
- codex/static_root/assets/group-tab-DkIN1Heu.css.br +0 -0
- codex/static_root/assets/group-tab-DkIN1Heu.css.gz +0 -0
- codex/static_root/assets/http-error-NHcwE5e_.d49089e40589.js +1 -0
- codex/static_root/assets/http-error-NHcwE5e_.d49089e40589.js.br +0 -0
- codex/static_root/assets/http-error-NHcwE5e_.d49089e40589.js.gz +0 -0
- codex/static_root/assets/http-error-NHcwE5e_.js +1 -0
- codex/static_root/assets/http-error-NHcwE5e_.js.br +0 -0
- codex/static_root/assets/http-error-NHcwE5e_.js.gz +0 -0
- codex/static_root/assets/index-CL_6g4tJ.523d7b3d350f.css +1 -0
- codex/static_root/assets/index-CL_6g4tJ.523d7b3d350f.css.br +0 -0
- codex/static_root/assets/index-CL_6g4tJ.523d7b3d350f.css.gz +0 -0
- codex/static_root/assets/index-CL_6g4tJ.css +1 -0
- codex/static_root/assets/index-CL_6g4tJ.css.br +0 -0
- codex/static_root/assets/index-CL_6g4tJ.css.gz +0 -0
- codex/static_root/assets/index-DYNNO5kn.24a2d270253a.js +1 -0
- codex/static_root/assets/index-DYNNO5kn.24a2d270253a.js.br +0 -0
- codex/static_root/assets/index-DYNNO5kn.24a2d270253a.js.gz +0 -0
- codex/static_root/assets/index-DYNNO5kn.js +1 -0
- codex/static_root/assets/index-DYNNO5kn.js.br +0 -0
- codex/static_root/assets/index-DYNNO5kn.js.gz +0 -0
- codex/static_root/assets/library-tab-CgIqcjvj.60327dfa8ecb.js +1 -0
- codex/static_root/assets/library-tab-CgIqcjvj.60327dfa8ecb.js.br +0 -0
- codex/static_root/assets/library-tab-CgIqcjvj.60327dfa8ecb.js.gz +0 -0
- codex/static_root/assets/library-tab-CgIqcjvj.js +1 -0
- codex/static_root/assets/library-tab-CgIqcjvj.js.br +0 -0
- codex/static_root/assets/library-tab-CgIqcjvj.js.gz +0 -0
- codex/static_root/assets/{library-tab-Bh7ErAk7.7c44200ee727.css → library-tab-Wew8YOLv.0c1780a6b68e.css} +1 -1
- codex/static_root/assets/library-tab-Wew8YOLv.0c1780a6b68e.css.br +0 -0
- codex/static_root/assets/library-tab-Wew8YOLv.0c1780a6b68e.css.gz +0 -0
- codex/static_root/assets/{library-tab-Bh7ErAk7.css → library-tab-Wew8YOLv.css} +1 -1
- codex/static_root/assets/library-tab-Wew8YOLv.css.br +0 -0
- codex/static_root/assets/library-tab-Wew8YOLv.css.gz +0 -0
- codex/static_root/assets/main-B3EwXQ3Q.14dfc21e272c.js +35 -0
- codex/static_root/assets/main-B3EwXQ3Q.14dfc21e272c.js.br +0 -0
- codex/static_root/assets/main-B3EwXQ3Q.14dfc21e272c.js.gz +0 -0
- codex/static_root/assets/main-B3EwXQ3Q.js +35 -0
- codex/static_root/assets/main-B3EwXQ3Q.js.br +0 -0
- codex/static_root/assets/main-B3EwXQ3Q.js.gz +0 -0
- codex/static_root/assets/pager-full-pdf-YkzUXx0B.f39d84e2380a.js +1 -0
- codex/static_root/assets/pager-full-pdf-YkzUXx0B.f39d84e2380a.js.br +0 -0
- codex/static_root/assets/pager-full-pdf-YkzUXx0B.f39d84e2380a.js.gz +0 -0
- codex/static_root/assets/pager-full-pdf-YkzUXx0B.js +1 -0
- codex/static_root/assets/pager-full-pdf-YkzUXx0B.js.br +0 -0
- codex/static_root/assets/pager-full-pdf-YkzUXx0B.js.gz +0 -0
- codex/static_root/assets/pagination-toolbar-CrruiVov.3bf9b795350d.js +1 -0
- codex/static_root/assets/pagination-toolbar-CrruiVov.3bf9b795350d.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-CrruiVov.3bf9b795350d.js.gz +0 -0
- codex/static_root/assets/pagination-toolbar-CrruiVov.js +1 -0
- codex/static_root/assets/pagination-toolbar-CrruiVov.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-CrruiVov.js.gz +0 -0
- codex/static_root/assets/{pagination-toolbar-BzruZPpu.css → pagination-toolbar-DGrxp2OD.css} +1 -1
- codex/static_root/assets/pagination-toolbar-DGrxp2OD.css.br +0 -0
- codex/static_root/assets/pagination-toolbar-DGrxp2OD.css.gz +0 -0
- codex/static_root/assets/{pagination-toolbar-BzruZPpu.397ad4e3d029.css → pagination-toolbar-DGrxp2OD.f960a624f04f.css} +1 -1
- codex/static_root/assets/pagination-toolbar-DGrxp2OD.f960a624f04f.css.br +0 -0
- codex/static_root/assets/pagination-toolbar-DGrxp2OD.f960a624f04f.css.gz +0 -0
- codex/static_root/assets/pdf-doc-CG5-AZ2M.b94aac7e3313.css +1 -0
- codex/static_root/assets/pdf-doc-CG5-AZ2M.b94aac7e3313.css.br +1 -0
- codex/static_root/assets/pdf-doc-CG5-AZ2M.b94aac7e3313.css.gz +0 -0
- codex/static_root/assets/pdf-doc-CG5-AZ2M.css +1 -0
- codex/static_root/assets/pdf-doc-CG5-AZ2M.css.br +1 -0
- codex/static_root/assets/pdf-doc-CG5-AZ2M.css.gz +0 -0
- codex/static_root/assets/{pdf-doc-C_RhfgHE.3d82cd502628.js → pdf-doc-ctqZIwOP.7e7b2c815ea4.js} +14 -14
- codex/static_root/assets/pdf-doc-ctqZIwOP.7e7b2c815ea4.js.br +0 -0
- codex/static_root/assets/pdf-doc-ctqZIwOP.7e7b2c815ea4.js.gz +0 -0
- codex/static_root/assets/{pdf-doc-C_RhfgHE.js → pdf-doc-ctqZIwOP.js} +14 -14
- codex/static_root/assets/pdf-doc-ctqZIwOP.js.br +0 -0
- codex/static_root/assets/pdf-doc-ctqZIwOP.js.gz +0 -0
- codex/static_root/assets/reader-DPLhdrJD.268417c618c5.js +2 -0
- codex/static_root/assets/reader-DPLhdrJD.268417c618c5.js.br +0 -0
- codex/static_root/assets/reader-DPLhdrJD.268417c618c5.js.gz +0 -0
- codex/static_root/assets/reader-DPLhdrJD.js +2 -0
- codex/static_root/assets/reader-DPLhdrJD.js.br +0 -0
- codex/static_root/assets/reader-DPLhdrJD.js.gz +0 -0
- codex/static_root/assets/reader-nD70BeEz.06e85e73c391.css +1 -0
- codex/static_root/assets/reader-nD70BeEz.06e85e73c391.css.br +0 -0
- codex/static_root/assets/reader-nD70BeEz.06e85e73c391.css.gz +0 -0
- codex/static_root/assets/reader-nD70BeEz.css +1 -0
- codex/static_root/assets/reader-nD70BeEz.css.br +0 -0
- codex/static_root/assets/reader-nD70BeEz.css.gz +0 -0
- codex/static_root/assets/relation-chips-DOALMcWL.5d3b8100ba03.js +1 -0
- codex/static_root/assets/relation-chips-DOALMcWL.5d3b8100ba03.js.br +0 -0
- codex/static_root/assets/relation-chips-DOALMcWL.5d3b8100ba03.js.gz +0 -0
- codex/static_root/assets/relation-chips-DOALMcWL.js +1 -0
- codex/static_root/assets/relation-chips-DOALMcWL.js.br +0 -0
- codex/static_root/assets/relation-chips-DOALMcWL.js.gz +0 -0
- codex/static_root/assets/settings-drawer-BVj1U_LC.c68369e0c2de.js +2 -0
- codex/static_root/assets/settings-drawer-BVj1U_LC.c68369e0c2de.js.br +0 -0
- codex/static_root/assets/settings-drawer-BVj1U_LC.c68369e0c2de.js.gz +0 -0
- codex/static_root/assets/settings-drawer-BVj1U_LC.js +2 -0
- codex/static_root/assets/settings-drawer-BVj1U_LC.js.br +0 -0
- codex/static_root/assets/settings-drawer-BVj1U_LC.js.gz +0 -0
- codex/static_root/assets/{stats-tab-BXGisn5N.9b7a71e7fe28.css → stats-tab-BAYTqQNg.5f715428c394.css} +1 -1
- codex/static_root/assets/stats-tab-BAYTqQNg.5f715428c394.css.br +0 -0
- codex/static_root/assets/stats-tab-BAYTqQNg.5f715428c394.css.gz +0 -0
- codex/static_root/assets/{stats-tab-BXGisn5N.css → stats-tab-BAYTqQNg.css} +1 -1
- codex/static_root/assets/stats-tab-BAYTqQNg.css.br +0 -0
- codex/static_root/assets/stats-tab-BAYTqQNg.css.gz +0 -0
- codex/static_root/assets/stats-tab-DDLwwwnP.35305258097b.js +1 -0
- codex/static_root/assets/stats-tab-DDLwwwnP.35305258097b.js.br +0 -0
- codex/static_root/assets/stats-tab-DDLwwwnP.35305258097b.js.gz +0 -0
- codex/static_root/assets/stats-tab-DDLwwwnP.js +1 -0
- codex/static_root/assets/stats-tab-DDLwwwnP.js.br +0 -0
- codex/static_root/assets/stats-tab-DDLwwwnP.js.gz +0 -0
- codex/static_root/assets/task-tab--cXi48kg.5dfd6890a1c2.css +1 -0
- codex/static_root/assets/{task-tab-1XiWn9xP.06cb8e1b794d.css.br → task-tab--cXi48kg.5dfd6890a1c2.css.br} +1 -1
- codex/static_root/assets/task-tab--cXi48kg.5dfd6890a1c2.css.gz +0 -0
- codex/static_root/assets/task-tab--cXi48kg.css +1 -0
- codex/static_root/assets/{task-tab-1XiWn9xP.css.br → task-tab--cXi48kg.css.br} +1 -1
- codex/static_root/assets/task-tab--cXi48kg.css.gz +0 -0
- codex/static_root/assets/task-tab-BpP3n2dO.c853eb565200.js +1 -0
- codex/static_root/assets/task-tab-BpP3n2dO.c853eb565200.js.br +0 -0
- codex/static_root/assets/task-tab-BpP3n2dO.c853eb565200.js.gz +0 -0
- codex/static_root/assets/task-tab-BpP3n2dO.js +1 -0
- codex/static_root/assets/task-tab-BpP3n2dO.js.br +0 -0
- codex/static_root/assets/task-tab-BpP3n2dO.js.gz +0 -0
- codex/static_root/assets/transition-3g2arGgl.c6e6f91b7978.js +1 -0
- codex/static_root/assets/transition-3g2arGgl.c6e6f91b7978.js.br +0 -0
- codex/static_root/assets/transition-3g2arGgl.c6e6f91b7978.js.gz +0 -0
- codex/static_root/assets/transition-3g2arGgl.js +1 -0
- codex/static_root/assets/transition-3g2arGgl.js.br +0 -0
- codex/static_root/assets/transition-3g2arGgl.js.gz +0 -0
- codex/static_root/assets/transition-5LRFTPo5.3d726f9bbcb0.css +1 -0
- codex/static_root/assets/transition-5LRFTPo5.3d726f9bbcb0.css.br +4 -0
- codex/static_root/assets/transition-5LRFTPo5.3d726f9bbcb0.css.gz +0 -0
- codex/static_root/assets/transition-5LRFTPo5.css +1 -0
- codex/static_root/assets/transition-5LRFTPo5.css.br +4 -0
- codex/static_root/assets/transition-5LRFTPo5.css.gz +0 -0
- codex/static_root/assets/{unauthorized-muDsv-rC.2166ec8b3a32.css → unauthorized-BjhIc97q.728511c92cd0.css} +1 -1
- codex/static_root/assets/unauthorized-BjhIc97q.728511c92cd0.css.br +0 -0
- codex/static_root/assets/unauthorized-BjhIc97q.728511c92cd0.css.gz +0 -0
- codex/static_root/assets/{unauthorized-muDsv-rC.css → unauthorized-BjhIc97q.css} +1 -1
- codex/static_root/assets/unauthorized-BjhIc97q.css.br +0 -0
- codex/static_root/assets/unauthorized-BjhIc97q.css.gz +0 -0
- codex/static_root/assets/unauthorized-CdumQ1Vf.79d9a61eb572.js +1 -0
- codex/static_root/assets/unauthorized-CdumQ1Vf.79d9a61eb572.js.br +0 -0
- codex/static_root/assets/unauthorized-CdumQ1Vf.79d9a61eb572.js.gz +0 -0
- codex/static_root/assets/unauthorized-CdumQ1Vf.js +1 -0
- codex/static_root/assets/unauthorized-CdumQ1Vf.js.br +0 -0
- codex/static_root/assets/unauthorized-CdumQ1Vf.js.gz +0 -0
- codex/static_root/assets/user-tab-D6oOKZTP.05944b00c700.js +1 -0
- codex/static_root/assets/user-tab-D6oOKZTP.05944b00c700.js.br +0 -0
- codex/static_root/assets/user-tab-D6oOKZTP.05944b00c700.js.gz +0 -0
- codex/static_root/assets/user-tab-D6oOKZTP.js +1 -0
- codex/static_root/assets/user-tab-D6oOKZTP.js.br +0 -0
- codex/static_root/assets/user-tab-D6oOKZTP.js.gz +0 -0
- codex/static_root/manifest.c5f1de88b1ac.json +712 -0
- codex/static_root/manifest.c5f1de88b1ac.json.br +0 -0
- codex/static_root/manifest.c5f1de88b1ac.json.gz +0 -0
- codex/static_root/manifest.json +395 -294
- codex/static_root/manifest.json.br +0 -0
- codex/static_root/manifest.json.gz +0 -0
- codex/static_root/staticfiles.json +1 -1
- codex/status_controller.py +15 -10
- codex/threads.py +1 -1
- codex/urls/api/auth.py +1 -1
- codex/urls/api/browser.py +1 -1
- codex/views/admin/library.py +18 -13
- codex/views/admin/stats.py +23 -16
- codex/views/admin/tasks.py +45 -40
- codex/views/auth.py +50 -74
- codex/views/bookmark.py +16 -153
- codex/views/browser/annotate/__init__.py +1 -0
- codex/views/browser/annotate/bookmark.py +112 -0
- codex/views/browser/annotate/card.py +61 -0
- codex/views/browser/annotate/order.py +247 -0
- codex/views/browser/breadcrumbs.py +90 -11
- codex/views/browser/browser.py +82 -117
- codex/views/browser/choices.py +15 -18
- codex/views/browser/cover.py +18 -24
- codex/views/browser/filters/bookmark.py +18 -19
- codex/views/browser/filters/field.py +8 -3
- codex/views/browser/filters/filter.py +69 -0
- codex/views/browser/filters/group.py +9 -6
- codex/views/browser/filters/search/__init__.py +1 -0
- codex/views/browser/filters/search/aliases.py +81 -0
- codex/views/browser/filters/search/field/__init__.py +1 -0
- codex/views/browser/filters/search/field/column.py +53 -0
- codex/views/browser/filters/search/field/expression.py +177 -0
- codex/views/browser/filters/search/field/filter.py +70 -0
- codex/views/browser/filters/search/field/optimize.py +71 -0
- codex/views/browser/filters/search/field/parse.py +187 -0
- codex/views/browser/filters/search/fts.py +24 -0
- codex/views/browser/filters/search/parse.py +250 -0
- codex/views/browser/group_mtime.py +83 -0
- codex/views/browser/metadata/__init__.py +1 -0
- codex/views/browser/metadata/annotate.py +109 -0
- codex/views/browser/metadata/copy_intersections.py +90 -0
- codex/views/browser/metadata/metadata.py +83 -0
- codex/views/browser/metadata/query_intersections.py +112 -0
- codex/views/browser/mtime.py +2 -10
- codex/views/browser/order_by.py +22 -16
- codex/views/browser/page_in_bounds.py +88 -0
- codex/views/browser/paginate.py +32 -123
- codex/views/browser/params.py +64 -0
- codex/views/browser/title.py +1 -6
- codex/views/browser/validate.py +68 -33
- codex/views/const.py +0 -1
- codex/views/download.py +1 -1
- codex/views/mixins.py +27 -15
- codex/views/opds/const.py +2 -3
- codex/views/opds/urls.py +2 -2
- codex/views/opds/util.py +2 -3
- codex/views/opds/v1/entry/links.py +3 -1
- codex/views/opds/v1/facets.py +65 -12
- codex/views/opds/v1/feed.py +7 -65
- codex/views/opds/v1/links.py +5 -4
- codex/views/opds/v2/feed.py +2 -28
- codex/views/opds/v2/links.py +27 -2
- codex/views/opds/v2/publications.py +5 -6
- codex/views/opds/v2/top_links.py +3 -6
- codex/views/public.py +2 -2
- codex/views/reader/arcs.py +0 -3
- codex/views/reader/books.py +57 -41
- codex/views/reader/page.py +13 -7
- codex/views/reader/{init.py → params.py} +38 -32
- codex/views/reader/reader.py +1 -2
- codex/views/session.py +43 -54
- codex/views/timezone.py +54 -0
- codex/views/version.py +1 -1
- {codex-1.6.18.dist-info → codex-1.7.0.dist-info}/METADATA +15 -10
- {codex-1.6.18.dist-info → codex-1.7.0.dist-info}/RECORD +474 -485
- codex/_vendor/__init__.py +0 -0
- codex/_vendor/django_haystack-3.2.1.dist-info/AUTHORS +0 -127
- codex/_vendor/django_haystack-3.2.1.dist-info/INSTALLER +0 -1
- codex/_vendor/django_haystack-3.2.1.dist-info/LICENSE +0 -31
- codex/_vendor/django_haystack-3.2.1.dist-info/METADATA +0 -98
- codex/_vendor/django_haystack-3.2.1.dist-info/RECORD +0 -97
- codex/_vendor/django_haystack-3.2.1.dist-info/REQUESTED +0 -0
- codex/_vendor/django_haystack-3.2.1.dist-info/WHEEL +0 -5
- codex/_vendor/django_haystack-3.2.1.dist-info/top_level.txt +0 -1
- codex/_vendor/haystack/__init__.py +0 -80
- codex/_vendor/haystack/admin.py +0 -163
- codex/_vendor/haystack/apps.py +0 -31
- codex/_vendor/haystack/backends/__init__.py +0 -1109
- codex/_vendor/haystack/backends/elasticsearch2_backend.py +0 -390
- codex/_vendor/haystack/backends/elasticsearch5_backend.py +0 -483
- codex/_vendor/haystack/backends/elasticsearch7_backend.py +0 -586
- codex/_vendor/haystack/backends/elasticsearch_backend.py +0 -1141
- codex/_vendor/haystack/backends/simple_backend.py +0 -132
- codex/_vendor/haystack/backends/solr_backend.py +0 -991
- codex/_vendor/haystack/backends/whoosh_backend.py +0 -1104
- codex/_vendor/haystack/constants.py +0 -57
- codex/_vendor/haystack/exceptions.py +0 -57
- codex/_vendor/haystack/fields.py +0 -562
- codex/_vendor/haystack/forms.py +0 -135
- codex/_vendor/haystack/generic_views.py +0 -141
- codex/_vendor/haystack/indexes.py +0 -548
- codex/_vendor/haystack/inputs.py +0 -169
- codex/_vendor/haystack/management/__init__.py +0 -0
- codex/_vendor/haystack/management/commands/__init__.py +0 -0
- codex/_vendor/haystack/management/commands/build_solr_schema.py +0 -187
- codex/_vendor/haystack/management/commands/clear_index.py +0 -67
- codex/_vendor/haystack/management/commands/haystack_info.py +0 -22
- codex/_vendor/haystack/management/commands/rebuild_index.py +0 -65
- codex/_vendor/haystack/management/commands/update_index.py +0 -438
- codex/_vendor/haystack/manager.py +0 -105
- codex/_vendor/haystack/models.py +0 -257
- codex/_vendor/haystack/panels.py +0 -89
- codex/_vendor/haystack/query.py +0 -771
- codex/_vendor/haystack/routers.py +0 -14
- codex/_vendor/haystack/signals.py +0 -88
- codex/_vendor/haystack/templates/panels/haystack.html +0 -33
- codex/_vendor/haystack/templates/search_configuration/schema.xml +0 -1056
- codex/_vendor/haystack/templates/search_configuration/solrconfig.xml +0 -1446
- codex/_vendor/haystack/templatetags/__init__.py +0 -0
- codex/_vendor/haystack/templatetags/highlight.py +0 -131
- codex/_vendor/haystack/templatetags/more_like_this.py +0 -119
- codex/_vendor/haystack/urls.py +0 -5
- codex/_vendor/haystack/utils/__init__.py +0 -84
- codex/_vendor/haystack/utils/app_loading.py +0 -34
- codex/_vendor/haystack/utils/geo.py +0 -71
- codex/_vendor/haystack/utils/highlighting.py +0 -165
- codex/_vendor/haystack/utils/loading.py +0 -374
- codex/_vendor/haystack/utils/log.py +0 -21
- codex/_vendor/haystack/version.py +0 -16
- codex/_vendor/haystack/views.py +0 -253
- codex/integrity.py +0 -492
- codex/librarian/search/merge.py +0 -86
- codex/librarian/search/version.py +0 -63
- codex/search/__init__.py +0 -1
- codex/search/backend.py +0 -524
- codex/search/backend_search.py +0 -229
- codex/search/engine.py +0 -33
- codex/search/indexes.py +0 -79
- codex/search/query.py +0 -67
- codex/search/writing.py +0 -180
- codex/serializers/choices.py +0 -196
- codex/static_root/assets/VCheckbox-D_kRyvnz.981ece08698f.js +0 -1
- codex/static_root/assets/VCheckbox-D_kRyvnz.981ece08698f.js.br +0 -0
- codex/static_root/assets/VCheckbox-D_kRyvnz.981ece08698f.js.gz +0 -0
- codex/static_root/assets/VCheckbox-D_kRyvnz.js +0 -1
- codex/static_root/assets/VCheckbox-D_kRyvnz.js.br +0 -0
- codex/static_root/assets/VCheckbox-D_kRyvnz.js.gz +0 -0
- codex/static_root/assets/VCheckboxBtn-CasNFNDK.3c20f8d4f5d9.js +0 -1
- codex/static_root/assets/VCheckboxBtn-CasNFNDK.3c20f8d4f5d9.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-CasNFNDK.3c20f8d4f5d9.js.gz +0 -0
- codex/static_root/assets/VCheckboxBtn-CasNFNDK.js +0 -1
- codex/static_root/assets/VCheckboxBtn-CasNFNDK.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-CasNFNDK.js.gz +0 -0
- codex/static_root/assets/VCombobox-BemG8ph3.afde3fec668d.js +0 -1
- codex/static_root/assets/VCombobox-BemG8ph3.afde3fec668d.js.br +0 -0
- codex/static_root/assets/VCombobox-BemG8ph3.afde3fec668d.js.gz +0 -0
- codex/static_root/assets/VCombobox-BemG8ph3.js +0 -1
- codex/static_root/assets/VCombobox-BemG8ph3.js.br +0 -0
- codex/static_root/assets/VCombobox-BemG8ph3.js.gz +0 -0
- codex/static_root/assets/VDialog-38np3TSA.5a0cb7a9e56d.css +0 -1
- codex/static_root/assets/VDialog-38np3TSA.5a0cb7a9e56d.css.br +0 -0
- codex/static_root/assets/VDialog-38np3TSA.5a0cb7a9e56d.css.gz +0 -0
- codex/static_root/assets/VDialog-38np3TSA.css +0 -1
- codex/static_root/assets/VDialog-38np3TSA.css.br +0 -0
- codex/static_root/assets/VDialog-38np3TSA.css.gz +0 -0
- codex/static_root/assets/VDialog-DOm1w6bL.3a8bac3e555f.js +0 -1
- codex/static_root/assets/VDialog-DOm1w6bL.3a8bac3e555f.js.br +0 -0
- codex/static_root/assets/VDialog-DOm1w6bL.3a8bac3e555f.js.gz +0 -0
- codex/static_root/assets/VDialog-DOm1w6bL.js +0 -1
- codex/static_root/assets/VDialog-DOm1w6bL.js.br +0 -0
- codex/static_root/assets/VDialog-DOm1w6bL.js.gz +0 -0
- codex/static_root/assets/VExpansionPanels-BIAAQEIk.536cfca15bf5.js +0 -1
- codex/static_root/assets/VExpansionPanels-BIAAQEIk.536cfca15bf5.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-BIAAQEIk.536cfca15bf5.js.gz +0 -0
- codex/static_root/assets/VExpansionPanels-BIAAQEIk.js +0 -1
- codex/static_root/assets/VExpansionPanels-BIAAQEIk.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-BIAAQEIk.js.gz +0 -0
- codex/static_root/assets/VRadioGroup-CQd2B2cC.5484da094948.js +0 -1
- codex/static_root/assets/VRadioGroup-CQd2B2cC.5484da094948.js.br +0 -0
- codex/static_root/assets/VRadioGroup-CQd2B2cC.5484da094948.js.gz +0 -0
- codex/static_root/assets/VRadioGroup-CQd2B2cC.js +0 -1
- codex/static_root/assets/VRadioGroup-CQd2B2cC.js.br +0 -0
- codex/static_root/assets/VRadioGroup-CQd2B2cC.js.gz +0 -0
- codex/static_root/assets/VSelect-Ca2bIOso.6613989e4c45.css +0 -1
- codex/static_root/assets/VSelect-Ca2bIOso.6613989e4c45.css.br +0 -0
- codex/static_root/assets/VSelect-Ca2bIOso.6613989e4c45.css.gz +0 -0
- codex/static_root/assets/VSelect-Ca2bIOso.css +0 -1
- codex/static_root/assets/VSelect-Ca2bIOso.css.br +0 -0
- codex/static_root/assets/VSelect-Ca2bIOso.css.gz +0 -0
- codex/static_root/assets/VSelect-DhYHkIlU.fcb6b4997b19.js +0 -1
- codex/static_root/assets/VSelect-DhYHkIlU.fcb6b4997b19.js.br +0 -0
- codex/static_root/assets/VSelect-DhYHkIlU.fcb6b4997b19.js.gz +0 -0
- codex/static_root/assets/VSelect-DhYHkIlU.js +0 -1
- codex/static_root/assets/VSelect-DhYHkIlU.js.br +0 -0
- codex/static_root/assets/VSelect-DhYHkIlU.js.gz +0 -0
- codex/static_root/assets/VSelectionControl-DZ7Z3QaY.753a2564123a.js +0 -1
- codex/static_root/assets/VSelectionControl-DZ7Z3QaY.753a2564123a.js.br +0 -0
- codex/static_root/assets/VSelectionControl-DZ7Z3QaY.753a2564123a.js.gz +0 -0
- codex/static_root/assets/VSelectionControl-DZ7Z3QaY.js +0 -1
- codex/static_root/assets/VSelectionControl-DZ7Z3QaY.js.br +0 -0
- codex/static_root/assets/VSelectionControl-DZ7Z3QaY.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-BfZo3lM5.0ffb08d15ccd.js +0 -1
- codex/static_root/assets/VSlideGroup-BfZo3lM5.0ffb08d15ccd.js.br +0 -0
- codex/static_root/assets/VSlideGroup-BfZo3lM5.0ffb08d15ccd.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-BfZo3lM5.js +0 -1
- codex/static_root/assets/VSlideGroup-BfZo3lM5.js.br +0 -0
- codex/static_root/assets/VSlideGroup-BfZo3lM5.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-Dk_1upHt.2c836070ec75.css +0 -1
- codex/static_root/assets/VSlideGroup-Dk_1upHt.2c836070ec75.css.br +0 -0
- codex/static_root/assets/VSlideGroup-Dk_1upHt.2c836070ec75.css.gz +0 -0
- codex/static_root/assets/VSlideGroup-Dk_1upHt.css +0 -1
- codex/static_root/assets/VSlideGroup-Dk_1upHt.css.br +0 -0
- codex/static_root/assets/VSlideGroup-Dk_1upHt.css.gz +0 -0
- codex/static_root/assets/VTable-xJS8rtC3.456750dc5d3f.js +0 -1
- codex/static_root/assets/VTable-xJS8rtC3.456750dc5d3f.js.br +0 -0
- codex/static_root/assets/VTable-xJS8rtC3.456750dc5d3f.js.gz +0 -0
- codex/static_root/assets/VTable-xJS8rtC3.js +0 -1
- codex/static_root/assets/VTable-xJS8rtC3.js.br +0 -0
- codex/static_root/assets/VTable-xJS8rtC3.js.gz +0 -0
- codex/static_root/assets/VTextField-CWKnATIB.7e07951afd27.js +0 -1
- codex/static_root/assets/VTextField-CWKnATIB.7e07951afd27.js.br +0 -0
- codex/static_root/assets/VTextField-CWKnATIB.7e07951afd27.js.gz +0 -0
- codex/static_root/assets/VTextField-CWKnATIB.js +0 -1
- codex/static_root/assets/VTextField-CWKnATIB.js.br +0 -0
- codex/static_root/assets/VTextField-CWKnATIB.js.gz +0 -0
- codex/static_root/assets/VTextField-Crc3gdNh.39995ccf4d52.css +0 -1
- codex/static_root/assets/VTextField-Crc3gdNh.39995ccf4d52.css.br +0 -0
- codex/static_root/assets/VTextField-Crc3gdNh.39995ccf4d52.css.gz +0 -0
- codex/static_root/assets/VTextField-Crc3gdNh.css +0 -1
- codex/static_root/assets/VTextField-Crc3gdNh.css.br +0 -0
- codex/static_root/assets/VTextField-Crc3gdNh.css.gz +0 -0
- codex/static_root/assets/VWindowItem-COG2FuUz.12a198f11fe7.js +0 -1
- codex/static_root/assets/VWindowItem-COG2FuUz.12a198f11fe7.js.br +0 -0
- codex/static_root/assets/VWindowItem-COG2FuUz.12a198f11fe7.js.gz +0 -0
- codex/static_root/assets/VWindowItem-COG2FuUz.js +0 -1
- codex/static_root/assets/VWindowItem-COG2FuUz.js.br +0 -0
- codex/static_root/assets/VWindowItem-COG2FuUz.js.gz +0 -0
- codex/static_root/assets/admin-CWEjaFr5.7d4523387384.css.br +0 -0
- codex/static_root/assets/admin-CWEjaFr5.7d4523387384.css.gz +0 -0
- codex/static_root/assets/admin-CWEjaFr5.css.br +0 -0
- codex/static_root/assets/admin-CWEjaFr5.css.gz +0 -0
- codex/static_root/assets/admin-Dl2A7cx-.5fbd345dbc05.js +0 -1
- codex/static_root/assets/admin-Dl2A7cx-.5fbd345dbc05.js.br +0 -0
- codex/static_root/assets/admin-Dl2A7cx-.5fbd345dbc05.js.gz +0 -0
- codex/static_root/assets/admin-Dl2A7cx-.js +0 -1
- codex/static_root/assets/admin-Dl2A7cx-.js.br +0 -0
- codex/static_root/assets/admin-Dl2A7cx-.js.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-Bs2wgKj3.3cb33056e994.css +0 -1
- codex/static_root/assets/admin-drawer-panel-Bs2wgKj3.3cb33056e994.css.br +0 -0
- codex/static_root/assets/admin-drawer-panel-Bs2wgKj3.3cb33056e994.css.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-Bs2wgKj3.css +0 -1
- codex/static_root/assets/admin-drawer-panel-Bs2wgKj3.css.br +0 -0
- codex/static_root/assets/admin-drawer-panel-Bs2wgKj3.css.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-D4CYCd_H.fd8dcc769daf.js +0 -30
- codex/static_root/assets/admin-drawer-panel-D4CYCd_H.fd8dcc769daf.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-D4CYCd_H.fd8dcc769daf.js.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-D4CYCd_H.js +0 -30
- codex/static_root/assets/admin-drawer-panel-D4CYCd_H.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-D4CYCd_H.js.gz +0 -0
- codex/static_root/assets/browser-Binc3n9H.313722d27ca3.css +0 -1
- codex/static_root/assets/browser-Binc3n9H.313722d27ca3.css.br +0 -0
- codex/static_root/assets/browser-Binc3n9H.313722d27ca3.css.gz +0 -0
- codex/static_root/assets/browser-Binc3n9H.css +0 -1
- codex/static_root/assets/browser-Binc3n9H.css.br +0 -0
- codex/static_root/assets/browser-Binc3n9H.css.gz +0 -0
- codex/static_root/assets/browser-DOhldfGx.43465be961b0.js +0 -1
- codex/static_root/assets/browser-DOhldfGx.43465be961b0.js.br +0 -0
- codex/static_root/assets/browser-DOhldfGx.43465be961b0.js.gz +0 -0
- codex/static_root/assets/browser-DOhldfGx.js +0 -1
- codex/static_root/assets/browser-DOhldfGx.js.br +0 -0
- codex/static_root/assets/browser-DOhldfGx.js.gz +0 -0
- codex/static_root/assets/change-password-dialog-Cebek1-c.aff2975e31f8.css +0 -1
- codex/static_root/assets/change-password-dialog-Cebek1-c.aff2975e31f8.css.br +0 -0
- codex/static_root/assets/change-password-dialog-Cebek1-c.aff2975e31f8.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-Cebek1-c.css +0 -1
- codex/static_root/assets/change-password-dialog-Cebek1-c.css.br +0 -0
- codex/static_root/assets/change-password-dialog-Cebek1-c.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-CrIdNi1F.9451b8d8e301.js +0 -1
- codex/static_root/assets/change-password-dialog-CrIdNi1F.9451b8d8e301.js.br +0 -0
- codex/static_root/assets/change-password-dialog-CrIdNi1F.9451b8d8e301.js.gz +0 -0
- codex/static_root/assets/change-password-dialog-CrIdNi1F.js +0 -1
- codex/static_root/assets/change-password-dialog-CrIdNi1F.js.br +0 -0
- codex/static_root/assets/change-password-dialog-CrIdNi1F.js.gz +0 -0
- codex/static_root/assets/confirm-dialog-B8T3Aamf.5d5b5715840a.js +0 -1
- codex/static_root/assets/confirm-dialog-B8T3Aamf.5d5b5715840a.js.br +0 -0
- codex/static_root/assets/confirm-dialog-B8T3Aamf.5d5b5715840a.js.gz +0 -0
- codex/static_root/assets/confirm-dialog-B8T3Aamf.js +0 -1
- codex/static_root/assets/confirm-dialog-B8T3Aamf.js.br +0 -0
- codex/static_root/assets/confirm-dialog-B8T3Aamf.js.gz +0 -0
- codex/static_root/assets/confirm-dialog-BmhedLCx.7c2103d319d4.css +0 -1
- codex/static_root/assets/confirm-dialog-BmhedLCx.css +0 -1
- codex/static_root/assets/datetime-column-DJjaMFv9.d281fe18446a.js +0 -1
- codex/static_root/assets/datetime-column-DJjaMFv9.d281fe18446a.js.br +0 -0
- codex/static_root/assets/datetime-column-DJjaMFv9.d281fe18446a.js.gz +0 -0
- codex/static_root/assets/datetime-column-DJjaMFv9.js +0 -1
- codex/static_root/assets/datetime-column-DJjaMFv9.js.br +0 -0
- codex/static_root/assets/datetime-column-DJjaMFv9.js.gz +0 -0
- codex/static_root/assets/filter-DMpQdE_u.8d88bbf01ae8.js +0 -1
- codex/static_root/assets/filter-DMpQdE_u.8d88bbf01ae8.js.br +0 -0
- codex/static_root/assets/filter-DMpQdE_u.8d88bbf01ae8.js.gz +0 -0
- codex/static_root/assets/filter-DMpQdE_u.js +0 -1
- codex/static_root/assets/filter-DMpQdE_u.js.br +0 -0
- codex/static_root/assets/filter-DMpQdE_u.js.gz +0 -0
- codex/static_root/assets/flag-tab-C2TvU4CO.7b424d4fedb2.js +0 -1
- codex/static_root/assets/flag-tab-C2TvU4CO.7b424d4fedb2.js.br +0 -0
- codex/static_root/assets/flag-tab-C2TvU4CO.7b424d4fedb2.js.gz +0 -0
- codex/static_root/assets/flag-tab-C2TvU4CO.js +0 -1
- codex/static_root/assets/flag-tab-C2TvU4CO.js.br +0 -0
- codex/static_root/assets/flag-tab-C2TvU4CO.js.gz +0 -0
- codex/static_root/assets/flag-tab-DBqpLKi7.css +0 -1
- codex/static_root/assets/flag-tab-DBqpLKi7.css.br +0 -0
- codex/static_root/assets/flag-tab-DBqpLKi7.css.gz +0 -0
- codex/static_root/assets/flag-tab-DBqpLKi7.dcfef39f541e.css +0 -1
- codex/static_root/assets/flag-tab-DBqpLKi7.dcfef39f541e.css.br +0 -0
- codex/static_root/assets/flag-tab-DBqpLKi7.dcfef39f541e.css.gz +0 -0
- codex/static_root/assets/group-tab-BOX6rJuK.58304d7d9f28.js +0 -1
- codex/static_root/assets/group-tab-BOX6rJuK.58304d7d9f28.js.br +0 -0
- codex/static_root/assets/group-tab-BOX6rJuK.58304d7d9f28.js.gz +0 -0
- codex/static_root/assets/group-tab-BOX6rJuK.js +0 -1
- codex/static_root/assets/group-tab-BOX6rJuK.js.br +0 -0
- codex/static_root/assets/group-tab-BOX6rJuK.js.gz +0 -0
- codex/static_root/assets/group-tab-CBKuS3Iv.7e4746634782.css +0 -1
- codex/static_root/assets/group-tab-CBKuS3Iv.7e4746634782.css.br +0 -0
- codex/static_root/assets/group-tab-CBKuS3Iv.7e4746634782.css.gz +0 -0
- codex/static_root/assets/group-tab-CBKuS3Iv.css +0 -1
- codex/static_root/assets/group-tab-CBKuS3Iv.css.br +0 -0
- codex/static_root/assets/group-tab-CBKuS3Iv.css.gz +0 -0
- codex/static_root/assets/http-error-E90fvnsx.103df54057a6.js +0 -1
- codex/static_root/assets/http-error-E90fvnsx.103df54057a6.js.br +0 -0
- codex/static_root/assets/http-error-E90fvnsx.103df54057a6.js.gz +0 -0
- codex/static_root/assets/http-error-E90fvnsx.js +0 -1
- codex/static_root/assets/http-error-E90fvnsx.js.br +0 -0
- codex/static_root/assets/http-error-E90fvnsx.js.gz +0 -0
- codex/static_root/assets/library-tab-Bh7ErAk7.7c44200ee727.css.br +0 -2
- codex/static_root/assets/library-tab-Bh7ErAk7.7c44200ee727.css.gz +0 -0
- codex/static_root/assets/library-tab-Bh7ErAk7.css.br +0 -2
- codex/static_root/assets/library-tab-Bh7ErAk7.css.gz +0 -0
- codex/static_root/assets/library-tab-DoLAFv6A.e504e9181e22.js +0 -1
- codex/static_root/assets/library-tab-DoLAFv6A.e504e9181e22.js.br +0 -0
- codex/static_root/assets/library-tab-DoLAFv6A.e504e9181e22.js.gz +0 -0
- codex/static_root/assets/library-tab-DoLAFv6A.js +0 -1
- codex/static_root/assets/library-tab-DoLAFv6A.js.br +0 -0
- codex/static_root/assets/library-tab-DoLAFv6A.js.gz +0 -0
- codex/static_root/assets/main-BnyyRHtu.383bd5bdf135.js +0 -6
- codex/static_root/assets/main-BnyyRHtu.383bd5bdf135.js.br +0 -0
- codex/static_root/assets/main-BnyyRHtu.383bd5bdf135.js.gz +0 -0
- codex/static_root/assets/main-BnyyRHtu.js +0 -6
- codex/static_root/assets/main-BnyyRHtu.js.br +0 -0
- codex/static_root/assets/main-BnyyRHtu.js.gz +0 -0
- codex/static_root/assets/pagination-toolbar-B-H-BgUh.0485a41335d7.js +0 -1
- codex/static_root/assets/pagination-toolbar-B-H-BgUh.0485a41335d7.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-B-H-BgUh.0485a41335d7.js.gz +0 -0
- codex/static_root/assets/pagination-toolbar-B-H-BgUh.js +0 -1
- codex/static_root/assets/pagination-toolbar-B-H-BgUh.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-B-H-BgUh.js.gz +0 -0
- codex/static_root/assets/pagination-toolbar-BzruZPpu.397ad4e3d029.css.br +0 -0
- codex/static_root/assets/pagination-toolbar-BzruZPpu.397ad4e3d029.css.gz +0 -0
- codex/static_root/assets/pagination-toolbar-BzruZPpu.css.br +0 -0
- codex/static_root/assets/pagination-toolbar-BzruZPpu.css.gz +0 -0
- codex/static_root/assets/pdf-doc-C_RhfgHE.3d82cd502628.js.br +0 -0
- codex/static_root/assets/pdf-doc-C_RhfgHE.3d82cd502628.js.gz +0 -0
- codex/static_root/assets/pdf-doc-C_RhfgHE.js.br +0 -0
- codex/static_root/assets/pdf-doc-C_RhfgHE.js.gz +0 -0
- codex/static_root/assets/pdf-doc-CkC2e3rI.css +0 -1
- codex/static_root/assets/pdf-doc-CkC2e3rI.css.br +0 -0
- codex/static_root/assets/pdf-doc-CkC2e3rI.css.gz +0 -0
- codex/static_root/assets/pdf-doc-CkC2e3rI.da75c385ebd0.css +0 -1
- codex/static_root/assets/pdf-doc-CkC2e3rI.da75c385ebd0.css.br +0 -0
- codex/static_root/assets/pdf-doc-CkC2e3rI.da75c385ebd0.css.gz +0 -0
- codex/static_root/assets/reader-DkEfQBw-.5e7781a737e6.css +0 -1
- codex/static_root/assets/reader-DkEfQBw-.5e7781a737e6.css.br +0 -0
- codex/static_root/assets/reader-DkEfQBw-.5e7781a737e6.css.gz +0 -0
- codex/static_root/assets/reader-DkEfQBw-.css +0 -1
- codex/static_root/assets/reader-DkEfQBw-.css.br +0 -0
- codex/static_root/assets/reader-DkEfQBw-.css.gz +0 -0
- codex/static_root/assets/reader-K27K1JrT.faa6edbda846.js +0 -2
- codex/static_root/assets/reader-K27K1JrT.faa6edbda846.js.br +0 -0
- codex/static_root/assets/reader-K27K1JrT.faa6edbda846.js.gz +0 -0
- codex/static_root/assets/reader-K27K1JrT.js +0 -2
- codex/static_root/assets/reader-K27K1JrT.js.br +0 -0
- codex/static_root/assets/reader-K27K1JrT.js.gz +0 -0
- codex/static_root/assets/relation-chips-CfHz9Cgt.ce0ab88180d5.js +0 -1
- codex/static_root/assets/relation-chips-CfHz9Cgt.ce0ab88180d5.js.br +0 -0
- codex/static_root/assets/relation-chips-CfHz9Cgt.ce0ab88180d5.js.gz +0 -0
- codex/static_root/assets/relation-chips-CfHz9Cgt.js +0 -1
- codex/static_root/assets/relation-chips-CfHz9Cgt.js.br +0 -0
- codex/static_root/assets/relation-chips-CfHz9Cgt.js.gz +0 -0
- codex/static_root/assets/settings-drawer-CF0z39tG.bb0427409b01.js +0 -2
- codex/static_root/assets/settings-drawer-CF0z39tG.bb0427409b01.js.br +0 -0
- codex/static_root/assets/settings-drawer-CF0z39tG.bb0427409b01.js.gz +0 -0
- codex/static_root/assets/settings-drawer-CF0z39tG.js +0 -2
- codex/static_root/assets/settings-drawer-CF0z39tG.js.br +0 -0
- codex/static_root/assets/settings-drawer-CF0z39tG.js.gz +0 -0
- codex/static_root/assets/stats-tab-BXGisn5N.9b7a71e7fe28.css.br +0 -0
- codex/static_root/assets/stats-tab-BXGisn5N.9b7a71e7fe28.css.gz +0 -0
- codex/static_root/assets/stats-tab-BXGisn5N.css.br +0 -0
- codex/static_root/assets/stats-tab-BXGisn5N.css.gz +0 -0
- codex/static_root/assets/stats-tab-m4jtc5tB.fe5a865d950f.js +0 -1
- codex/static_root/assets/stats-tab-m4jtc5tB.fe5a865d950f.js.br +0 -0
- codex/static_root/assets/stats-tab-m4jtc5tB.fe5a865d950f.js.gz +0 -0
- codex/static_root/assets/stats-tab-m4jtc5tB.js +0 -1
- codex/static_root/assets/stats-tab-m4jtc5tB.js.br +0 -0
- codex/static_root/assets/stats-tab-m4jtc5tB.js.gz +0 -0
- codex/static_root/assets/task-tab-1XiWn9xP.06cb8e1b794d.css +0 -1
- codex/static_root/assets/task-tab-1XiWn9xP.06cb8e1b794d.css.gz +0 -0
- codex/static_root/assets/task-tab-1XiWn9xP.css +0 -1
- codex/static_root/assets/task-tab-1XiWn9xP.css.gz +0 -0
- codex/static_root/assets/task-tab-Bn04U_1c.3b343f42f0a9.js +0 -1
- codex/static_root/assets/task-tab-Bn04U_1c.3b343f42f0a9.js.br +0 -0
- codex/static_root/assets/task-tab-Bn04U_1c.3b343f42f0a9.js.gz +0 -0
- codex/static_root/assets/task-tab-Bn04U_1c.js +0 -1
- codex/static_root/assets/task-tab-Bn04U_1c.js.br +0 -0
- codex/static_root/assets/task-tab-Bn04U_1c.js.gz +0 -0
- codex/static_root/assets/unauthorized-CFFrmehB.25307184f821.js +0 -1
- codex/static_root/assets/unauthorized-CFFrmehB.25307184f821.js.br +0 -0
- codex/static_root/assets/unauthorized-CFFrmehB.25307184f821.js.gz +0 -0
- codex/static_root/assets/unauthorized-CFFrmehB.js +0 -1
- codex/static_root/assets/unauthorized-CFFrmehB.js.br +0 -0
- codex/static_root/assets/unauthorized-CFFrmehB.js.gz +0 -0
- codex/static_root/assets/unauthorized-muDsv-rC.2166ec8b3a32.css.br +0 -0
- codex/static_root/assets/unauthorized-muDsv-rC.2166ec8b3a32.css.gz +0 -0
- codex/static_root/assets/unauthorized-muDsv-rC.css.br +0 -0
- codex/static_root/assets/unauthorized-muDsv-rC.css.gz +0 -0
- codex/static_root/assets/user-tab-Bc0BOX75.96057d32f1e9.js +0 -1
- codex/static_root/assets/user-tab-Bc0BOX75.96057d32f1e9.js.br +0 -0
- codex/static_root/assets/user-tab-Bc0BOX75.96057d32f1e9.js.gz +0 -0
- codex/static_root/assets/user-tab-Bc0BOX75.js +0 -1
- codex/static_root/assets/user-tab-Bc0BOX75.js.br +0 -0
- codex/static_root/assets/user-tab-Bc0BOX75.js.gz +0 -0
- codex/static_root/js/choices-admin.1a20a5648f20.json +0 -1
- codex/static_root/js/choices-admin.1a20a5648f20.json.br +0 -0
- codex/static_root/js/choices-admin.1a20a5648f20.json.gz +0 -0
- codex/static_root/js/choices-admin.json +0 -1
- codex/static_root/js/choices-admin.json.br +0 -0
- codex/static_root/js/choices-admin.json.gz +0 -0
- codex/static_root/js/choices.2f6b0359e1ef.json +0 -1
- codex/static_root/js/choices.2f6b0359e1ef.json.br +0 -0
- codex/static_root/js/choices.2f6b0359e1ef.json.gz +0 -0
- codex/static_root/js/choices.json +0 -1
- codex/static_root/js/choices.json.br +0 -0
- codex/static_root/js/choices.json.gz +0 -0
- codex/static_root/manifest.5127f11299cc.json +0 -611
- codex/static_root/manifest.5127f11299cc.json.br +0 -0
- codex/static_root/manifest.5127f11299cc.json.gz +0 -0
- codex/templates/search/indexes/codex/comic_text.txt +0 -47
- codex/views/browser/annotations.py +0 -296
- codex/views/browser/base.py +0 -140
- codex/views/browser/filters/annotations.py +0 -103
- codex/views/browser/filters/search.py +0 -196
- codex/views/browser/metadata.py +0 -332
- {codex-1.6.18.dist-info → codex-1.7.0.dist-info}/LICENSE +0 -0
- {codex-1.6.18.dist-info → codex-1.7.0.dist-info}/WHEEL +0 -0
- {codex-1.6.18.dist-info → codex-1.7.0.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"""Parse the browser query by removing field queries and doing them with the ORM."""
|
|
2
|
+
|
|
3
|
+
from django.db.models import Q
|
|
4
|
+
|
|
5
|
+
from codex.logger.logging import get_logger
|
|
6
|
+
from codex.views.browser.filters.field import ComicFieldFilterView
|
|
7
|
+
from codex.views.browser.filters.search.field.column import parse_field
|
|
8
|
+
from codex.views.browser.filters.search.field.parse import get_field_query
|
|
9
|
+
|
|
10
|
+
LOG = get_logger(__name__)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class BrowserFieldQueryFilter(ComicFieldFilterView):
|
|
14
|
+
"""Parse the browser query by removing field queries and doing them with the ORM."""
|
|
15
|
+
|
|
16
|
+
@staticmethod
|
|
17
|
+
def _combine_q(q, other_q, op):
|
|
18
|
+
if isinstance(other_q, tuple):
|
|
19
|
+
rel, val = other_q
|
|
20
|
+
if rel.endswith("__like") and val == "%":
|
|
21
|
+
# Remove likes that would match everything
|
|
22
|
+
return q
|
|
23
|
+
other_q = Q(**{rel: val})
|
|
24
|
+
if op == Q.AND:
|
|
25
|
+
q &= other_q
|
|
26
|
+
else:
|
|
27
|
+
q |= other_q
|
|
28
|
+
return q
|
|
29
|
+
|
|
30
|
+
@classmethod
|
|
31
|
+
def _hoist_filters(cls, filter_q_list, exclude_q_list, new_q):
|
|
32
|
+
"""Peel top layer of queries into multiple filter and exclude clauses."""
|
|
33
|
+
# This makes m2m queries behave more as expected and may optimize fk queries.
|
|
34
|
+
if new_q.connector == Q.AND:
|
|
35
|
+
for child in new_q.children:
|
|
36
|
+
if isinstance(child, Q) and child.negated:
|
|
37
|
+
child.negated = False
|
|
38
|
+
q = cls._combine_q(Q(), child, new_q.connector)
|
|
39
|
+
exclude_q_list.append(q)
|
|
40
|
+
else:
|
|
41
|
+
q = cls._combine_q(Q(), child, new_q.connector)
|
|
42
|
+
filter_q_list.append(q)
|
|
43
|
+
else:
|
|
44
|
+
filter_q_list[0] = cls._combine_q(filter_q_list[0], new_q, new_q.connector)
|
|
45
|
+
|
|
46
|
+
def _parse_field_query(self, col, exp, model, filter_q_list, exclude_q_list):
|
|
47
|
+
try:
|
|
48
|
+
rel_class, rel, many_to_many = parse_field(col)
|
|
49
|
+
|
|
50
|
+
if q := get_field_query(rel, rel_class, exp, model, many_to_many):
|
|
51
|
+
self._hoist_filters(filter_q_list, exclude_q_list, q)
|
|
52
|
+
except Exception as exc:
|
|
53
|
+
token = f"{col}:{exp}"
|
|
54
|
+
msg = f"Parsing field query {token} - {exc}"
|
|
55
|
+
LOG.warning(msg)
|
|
56
|
+
self.search_error = msg
|
|
57
|
+
|
|
58
|
+
def get_search_field_filters(self, model, field_token_pairs):
|
|
59
|
+
"""Parse and apply field query filters."""
|
|
60
|
+
filter_q_list = []
|
|
61
|
+
exclude_q_list = []
|
|
62
|
+
if not field_token_pairs:
|
|
63
|
+
return filter_q_list, exclude_q_list
|
|
64
|
+
|
|
65
|
+
filter_q_list.append(Q())
|
|
66
|
+
exclude_q_list.append(Q())
|
|
67
|
+
for col, exp in field_token_pairs:
|
|
68
|
+
self._parse_field_query(col, exp, model, filter_q_list, exclude_q_list)
|
|
69
|
+
|
|
70
|
+
return filter_q_list, exclude_q_list
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"""Optimize Text Lookups."""
|
|
2
|
+
# XXX Unused XXX multiple like queries test better
|
|
3
|
+
|
|
4
|
+
import re
|
|
5
|
+
|
|
6
|
+
from django.db.models import Q
|
|
7
|
+
|
|
8
|
+
# Just an unlikely character
|
|
9
|
+
_PERCENT_PLACEHOLDER = "Ɍ"
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _like_to_regex(like):
|
|
13
|
+
"""Transform a glob into a safe regex for sqlite3."""
|
|
14
|
+
# unescape like
|
|
15
|
+
like = like.replace(r"\%", _PERCENT_PLACEHOLDER)
|
|
16
|
+
like = like.replace(r"\_", "_")
|
|
17
|
+
|
|
18
|
+
while like[0] == "%" and like[-1] == "%":
|
|
19
|
+
like = like[1:-1]
|
|
20
|
+
|
|
21
|
+
parts = like
|
|
22
|
+
|
|
23
|
+
prefix = suffix = ""
|
|
24
|
+
|
|
25
|
+
if parts[0] == "%":
|
|
26
|
+
parts = parts[1:]
|
|
27
|
+
suffix = "$"
|
|
28
|
+
elif parts[-1] == "%":
|
|
29
|
+
parts = parts[:-1]
|
|
30
|
+
prefix = "^"
|
|
31
|
+
|
|
32
|
+
if not parts:
|
|
33
|
+
return parts
|
|
34
|
+
|
|
35
|
+
regex = parts.replace(_PERCENT_PLACEHOLDER, "%")
|
|
36
|
+
regex = re.escape(regex)
|
|
37
|
+
regex = regex.replace("%", ".*")
|
|
38
|
+
|
|
39
|
+
return prefix + regex + suffix
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def _regex_like(regex, lookahead):
|
|
43
|
+
"""Bracket a regex with any characters if positive lookahead."""
|
|
44
|
+
if lookahead == "=":
|
|
45
|
+
regex = ".*" + regex + ".*"
|
|
46
|
+
return regex
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def like_qs_to_regex_q(q: Q, regex_op: str, many_to_many: bool):
|
|
50
|
+
"""Optimize a tree of like lookup qs to one regex q."""
|
|
51
|
+
regexes = []
|
|
52
|
+
# Optimize like equations into regexes
|
|
53
|
+
rel = ""
|
|
54
|
+
|
|
55
|
+
if many_to_many:
|
|
56
|
+
regex_op = "|"
|
|
57
|
+
|
|
58
|
+
lookahead = "!" if q.negated else ":" if regex_op == "|" else "="
|
|
59
|
+
for child_q in q.children:
|
|
60
|
+
rel, like = child_q
|
|
61
|
+
value = _like_to_regex(like)
|
|
62
|
+
value = _regex_like(value, lookahead)
|
|
63
|
+
regex = rf"(?{lookahead}{value})"
|
|
64
|
+
regexes.append(regex)
|
|
65
|
+
|
|
66
|
+
regex_value = regex_op.join(regexes)
|
|
67
|
+
regex_value = _regex_like(regex_value, lookahead)
|
|
68
|
+
|
|
69
|
+
rel = rel.replace("like", "iregex")
|
|
70
|
+
|
|
71
|
+
return Q(**{rel: regex_value})
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
"""Parse field boolean expressions into Django ORM Queries."""
|
|
2
|
+
|
|
3
|
+
import re
|
|
4
|
+
from typing import TYPE_CHECKING
|
|
5
|
+
|
|
6
|
+
from django.db.models import Q
|
|
7
|
+
from pyparsing import (
|
|
8
|
+
CaselessLiteral,
|
|
9
|
+
OpAssoc,
|
|
10
|
+
ParserElement,
|
|
11
|
+
QuotedString,
|
|
12
|
+
Word,
|
|
13
|
+
infix_notation,
|
|
14
|
+
printables,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
from codex.models.base import MAX_NAME_LEN
|
|
18
|
+
from codex.models.comic import Comic
|
|
19
|
+
from codex.views.browser.filters.search.field.expression import parse_expression
|
|
20
|
+
|
|
21
|
+
if TYPE_CHECKING:
|
|
22
|
+
from pyparsing.helpers import InfixNotationOperatorSpec
|
|
23
|
+
|
|
24
|
+
_QUOTES_REXP = r"(?:\".*?\")"
|
|
25
|
+
_OPERATORS_REXP = "|".join(("and not", "or not", "and", "or"))
|
|
26
|
+
_BEGIN_NOT_REXP = r"^\s*\(?\s*(?P<not>not)"
|
|
27
|
+
_IMPLICIT_AND_REXP = (
|
|
28
|
+
rf"{_QUOTES_REXP}|\ (?P<ok>{_OPERATORS_REXP})\ |(?P<bare>(?:\ not)?\ )\S"
|
|
29
|
+
)
|
|
30
|
+
_BEGIN_NOT_RE = re.compile(_BEGIN_NOT_REXP, flags=re.IGNORECASE)
|
|
31
|
+
_IMPLICIT_AND_RE = re.compile(_IMPLICIT_AND_REXP, flags=re.IGNORECASE)
|
|
32
|
+
ParserElement.enablePackrat()
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class BoolOperand:
|
|
36
|
+
"""Hacky Base for injecting rel."""
|
|
37
|
+
|
|
38
|
+
def __init__(self, tokens, context):
|
|
39
|
+
"""Initialize value from first token."""
|
|
40
|
+
self.value = tokens[0]
|
|
41
|
+
self.context = context
|
|
42
|
+
|
|
43
|
+
def __repr__(self) -> str:
|
|
44
|
+
"""Represent as string."""
|
|
45
|
+
return str(self.value)
|
|
46
|
+
|
|
47
|
+
def _prefix_q_dict(self, q_dict):
|
|
48
|
+
"""Add (or subtract!) relation prefixes to q_dict for the model."""
|
|
49
|
+
model = self.context[2]
|
|
50
|
+
prefix = "" if model == Comic else "comic__"
|
|
51
|
+
model_span = model.__name__.lower() + "__"
|
|
52
|
+
prefixed_q_dict = {}
|
|
53
|
+
for parsed_rel, value in q_dict.items():
|
|
54
|
+
prefixed_rel = (
|
|
55
|
+
parsed_rel.removeprefix(model_span)
|
|
56
|
+
if parsed_rel.startswith(model_span)
|
|
57
|
+
else prefix + parsed_rel
|
|
58
|
+
)
|
|
59
|
+
prefixed_q_dict[prefixed_rel] = value
|
|
60
|
+
return prefixed_q_dict
|
|
61
|
+
|
|
62
|
+
def to_query(self) -> Q:
|
|
63
|
+
"""Construct Django ORM Query from rel & value."""
|
|
64
|
+
rel = self.context[0]
|
|
65
|
+
rel_class = self.context[1]
|
|
66
|
+
q_dict = parse_expression(rel, rel_class, self.value)
|
|
67
|
+
if not q_dict:
|
|
68
|
+
return Q()
|
|
69
|
+
|
|
70
|
+
prefixed_q_dict = self._prefix_q_dict(q_dict)
|
|
71
|
+
|
|
72
|
+
return Q(**prefixed_q_dict)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
class BoolNot(BoolOperand):
|
|
76
|
+
"""NOT Operand."""
|
|
77
|
+
|
|
78
|
+
def __init__(self, tokens, context):
|
|
79
|
+
"""Initialize args from first token."""
|
|
80
|
+
self.arg = tokens[0][1]
|
|
81
|
+
self.context = context
|
|
82
|
+
|
|
83
|
+
def __repr__(self) -> str:
|
|
84
|
+
"""Represent as string."""
|
|
85
|
+
return f"NOT {self.arg}"
|
|
86
|
+
|
|
87
|
+
def to_query(self) -> Q:
|
|
88
|
+
"""Negate argument query."""
|
|
89
|
+
q = self.arg.to_query()
|
|
90
|
+
return ~q
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
class BoolBinaryOperand:
|
|
94
|
+
"""Boolean Binary Operand."""
|
|
95
|
+
|
|
96
|
+
OP: str = ""
|
|
97
|
+
|
|
98
|
+
def __init__(self, tokens, context):
|
|
99
|
+
"""Initialize args from first two tokens."""
|
|
100
|
+
self.args = tokens[0][0::2]
|
|
101
|
+
self.context = context
|
|
102
|
+
|
|
103
|
+
def __repr__(self) -> str:
|
|
104
|
+
"""Represent as string."""
|
|
105
|
+
sep = f" {self.OP} "
|
|
106
|
+
return f"({sep.join(map(str, self.args))})"
|
|
107
|
+
|
|
108
|
+
def to_query(self) -> Q:
|
|
109
|
+
"""Construct Django ORM Query from args."""
|
|
110
|
+
q = Q()
|
|
111
|
+
|
|
112
|
+
for arg in self.args:
|
|
113
|
+
arg_q = arg.to_query()
|
|
114
|
+
if self.OP == Q.AND:
|
|
115
|
+
q &= arg_q
|
|
116
|
+
else:
|
|
117
|
+
q |= arg_q
|
|
118
|
+
|
|
119
|
+
return q
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
class BoolAnd(BoolBinaryOperand):
|
|
123
|
+
"""AND Operand."""
|
|
124
|
+
|
|
125
|
+
OP = Q.AND
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
class BoolOr(BoolBinaryOperand):
|
|
129
|
+
"""OR Operand."""
|
|
130
|
+
|
|
131
|
+
OP = Q.OR
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
def _get_context_operand(op_class, context):
|
|
135
|
+
"""Hack context into operands."""
|
|
136
|
+
|
|
137
|
+
def parse_action(_s, _loc, toks):
|
|
138
|
+
"""Inject context into operand classes."""
|
|
139
|
+
return op_class(toks, context)
|
|
140
|
+
|
|
141
|
+
return parse_action
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
def _create_context_expression(context):
|
|
145
|
+
# I can't find a way for pyparsing to inject context after the grammar is defined.
|
|
146
|
+
bool_operand_fn = _get_context_operand(BoolOperand, context)
|
|
147
|
+
bool_not_operand_fn = _get_context_operand(BoolNot, context)
|
|
148
|
+
bool_and_operand_fn = _get_context_operand(BoolAnd, context)
|
|
149
|
+
bool_or_operand_fn = _get_context_operand(BoolOr, context)
|
|
150
|
+
|
|
151
|
+
# Order is important for operands so quoted strings get parsed first
|
|
152
|
+
bool_operand = QuotedString('"') | Word(
|
|
153
|
+
printables, exclude_chars="(),", max=MAX_NAME_LEN
|
|
154
|
+
)
|
|
155
|
+
bool_operand.set_parse_action(bool_operand_fn)
|
|
156
|
+
bool_operand.set_name("boolean_operand")
|
|
157
|
+
op_list: list[InfixNotationOperatorSpec] = [
|
|
158
|
+
# In order of precedence
|
|
159
|
+
(CaselessLiteral("not"), 1, OpAssoc.RIGHT, bool_not_operand_fn),
|
|
160
|
+
(CaselessLiteral("and"), 2, OpAssoc.LEFT, bool_and_operand_fn),
|
|
161
|
+
(CaselessLiteral("or"), 2, OpAssoc.LEFT, bool_or_operand_fn),
|
|
162
|
+
]
|
|
163
|
+
|
|
164
|
+
bool_expr = infix_notation(bool_operand, op_list)
|
|
165
|
+
bool_expr.set_name("boolean_expression")
|
|
166
|
+
return bool_expr
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
def get_field_query(rel, rel_class, exp, model, many_to_many):
|
|
170
|
+
"""Convert rel and text expression into queries."""
|
|
171
|
+
# Allow negative column search
|
|
172
|
+
begin_not_match = _BEGIN_NOT_RE.search(exp)
|
|
173
|
+
if begin_not_match:
|
|
174
|
+
start = begin_not_match.start("not")
|
|
175
|
+
exp = exp[:start] + '"" and ' + exp[start:]
|
|
176
|
+
|
|
177
|
+
# Add implicit and for the parser
|
|
178
|
+
exp = _IMPLICIT_AND_RE.sub(
|
|
179
|
+
lambda m: f" and{m.group(0)}" if m.group("bare") else m.group(0), exp
|
|
180
|
+
)
|
|
181
|
+
|
|
182
|
+
context = rel, rel_class, model, many_to_many
|
|
183
|
+
bool_expr = _create_context_expression(context)
|
|
184
|
+
|
|
185
|
+
parsed_result = bool_expr.parse_string(exp)
|
|
186
|
+
root_bool_operand: BoolOperand = parsed_result[0] # type:ignore
|
|
187
|
+
return root_bool_operand.to_query()
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"""Search Filters Methods."""
|
|
2
|
+
|
|
3
|
+
from codex.logger.logging import get_logger
|
|
4
|
+
from codex.views.browser.filters.search.field.filter import BrowserFieldQueryFilter
|
|
5
|
+
|
|
6
|
+
LOG = get_logger(__name__)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class BrowserFTSFilter(BrowserFieldQueryFilter):
|
|
10
|
+
"""Search Filters Methods."""
|
|
11
|
+
|
|
12
|
+
def get_fts_filter(self, model, text):
|
|
13
|
+
"""Perform the search and return the scores as a dict."""
|
|
14
|
+
fts_filter = {}
|
|
15
|
+
try:
|
|
16
|
+
if text:
|
|
17
|
+
rel = self.get_rel_prefix(model)
|
|
18
|
+
# Custom lookup defined in codex.models
|
|
19
|
+
rel += "comicfts__match"
|
|
20
|
+
fts_filter[rel] = text
|
|
21
|
+
except Exception:
|
|
22
|
+
LOG.exception("Getting Full Text Search Filter.")
|
|
23
|
+
self.search_error = "Error creating full text search filter"
|
|
24
|
+
return fts_filter
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
"""Search Filters Methods."""
|
|
2
|
+
|
|
3
|
+
import re
|
|
4
|
+
from types import MappingProxyType
|
|
5
|
+
|
|
6
|
+
from django.db.models.query import Q
|
|
7
|
+
|
|
8
|
+
from codex.logger.logging import get_logger
|
|
9
|
+
from codex.models import AdminFlag
|
|
10
|
+
from codex.models.comic import ComicFTS
|
|
11
|
+
from codex.views.browser.filters.search.aliases import ALIAS_FIELD_MAP
|
|
12
|
+
from codex.views.browser.filters.search.fts import BrowserFTSFilter
|
|
13
|
+
from codex.views.const import MAX_OBJ_PER_PAGE
|
|
14
|
+
|
|
15
|
+
LOG = get_logger(__name__)
|
|
16
|
+
_FTS_COLUMNS = frozenset(
|
|
17
|
+
{field.name for field in ComicFTS._meta.get_fields()}
|
|
18
|
+
- {"comic", "updated_at", "created_at"}
|
|
19
|
+
)
|
|
20
|
+
_NON_FTS_COLUMNS = frozenset(
|
|
21
|
+
{
|
|
22
|
+
"volume",
|
|
23
|
+
"created_at",
|
|
24
|
+
"updated_at",
|
|
25
|
+
"issue_number",
|
|
26
|
+
"issue_suffix",
|
|
27
|
+
"year",
|
|
28
|
+
"month",
|
|
29
|
+
"day",
|
|
30
|
+
"community_rating",
|
|
31
|
+
"criticial_rating",
|
|
32
|
+
"page_count",
|
|
33
|
+
"monochrome",
|
|
34
|
+
"date",
|
|
35
|
+
"decade",
|
|
36
|
+
"size",
|
|
37
|
+
"path",
|
|
38
|
+
"identifier",
|
|
39
|
+
"identifier_type",
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
_VALID_COLUMNS = frozenset(_FTS_COLUMNS | _NON_FTS_COLUMNS)
|
|
43
|
+
_QUOTES_REXP = r"\".*?\""
|
|
44
|
+
_COLUMN_EXPRESSION_OPERATORS_REXP = (
|
|
45
|
+
rf"(?:{_QUOTES_REXP})|(?P<star>\B[\*\<\>]\w|\.{2,}|\w\*\w)"
|
|
46
|
+
)
|
|
47
|
+
_COLUMN_EXPRESSION_OPERATORS_RE = re.compile(_COLUMN_EXPRESSION_OPERATORS_REXP)
|
|
48
|
+
_FTS_OPERATORS = frozenset({"and", "not", "or", "near"})
|
|
49
|
+
_FTS_OPERATOR_REXP = rf"(?P<operator>\b{'|'.join(_FTS_OPERATORS)}\b)"
|
|
50
|
+
_FTS_OPERATOR_RE = re.compile(_FTS_OPERATOR_REXP, flags=re.IGNORECASE)
|
|
51
|
+
_MULTI_COL_REXP = r"(?P<multi_col>\{.*?\})"
|
|
52
|
+
_SINGLE_COL_REXP = r"(?P<col>[a-z_]+)"
|
|
53
|
+
_EXP_REXP = rf"\s*(?P<exp>\(.*?\)|{_QUOTES_REXP}|\S+)"
|
|
54
|
+
_COL_REXP = rf"({_MULTI_COL_REXP}|{_SINGLE_COL_REXP}):{_EXP_REXP}"
|
|
55
|
+
_TOKEN_PRE_OP_REXP = r"(?:(?P<preop>and|or|not)\s+)?" # noqa: S105
|
|
56
|
+
_TOKEN_REXP = rf"(?P<token>{_TOKEN_PRE_OP_REXP}{_COL_REXP}|\S+)"
|
|
57
|
+
_TOKEN_RE = re.compile(_TOKEN_REXP, flags=re.IGNORECASE)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
class SearchFilterView(BrowserFTSFilter):
|
|
61
|
+
"""Search Query Parser."""
|
|
62
|
+
|
|
63
|
+
ADMIN_FLAG_VALUE_KEY_MAP = MappingProxyType(
|
|
64
|
+
{
|
|
65
|
+
AdminFlag.FlagChoices.FOLDER_VIEW.value: "folder_view",
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
def __init__(self, *args, **kwargs):
|
|
70
|
+
"""Initialize search variables."""
|
|
71
|
+
super().__init__(*args, **kwargs)
|
|
72
|
+
self._admin_flags: MappingProxyType[str, bool] | None = None
|
|
73
|
+
self.fts_mode = False
|
|
74
|
+
self.search_mode = False
|
|
75
|
+
self.search_error = ""
|
|
76
|
+
|
|
77
|
+
@property
|
|
78
|
+
def admin_flags(self) -> MappingProxyType[str, bool]:
|
|
79
|
+
"""Set browser relevant admin flags."""
|
|
80
|
+
if self._admin_flags is None:
|
|
81
|
+
if self.ADMIN_FLAG_VALUE_KEY_MAP:
|
|
82
|
+
admin_pairs = AdminFlag.objects.filter(
|
|
83
|
+
key__in=self.ADMIN_FLAG_VALUE_KEY_MAP.keys()
|
|
84
|
+
).values_list("key", "on")
|
|
85
|
+
else:
|
|
86
|
+
admin_pairs = ()
|
|
87
|
+
admin_flags = {}
|
|
88
|
+
for key, on in admin_pairs:
|
|
89
|
+
export_key = self.ADMIN_FLAG_VALUE_KEY_MAP[key]
|
|
90
|
+
admin_flags[export_key] = on
|
|
91
|
+
self._admin_flags = MappingProxyType(admin_flags)
|
|
92
|
+
return self._admin_flags
|
|
93
|
+
|
|
94
|
+
def _is_path_column_allowed(self):
|
|
95
|
+
"""Is path column allowed."""
|
|
96
|
+
return self.is_admin or bool(self.admin_flags["folder_view"])
|
|
97
|
+
|
|
98
|
+
@staticmethod
|
|
99
|
+
def _is_column_operators_used(exp) -> bool:
|
|
100
|
+
"""Detect column expression operators, but not inside quotes."""
|
|
101
|
+
for match in _COLUMN_EXPRESSION_OPERATORS_RE.finditer(exp):
|
|
102
|
+
if match.group("star"):
|
|
103
|
+
return True
|
|
104
|
+
return False
|
|
105
|
+
|
|
106
|
+
def _parse_column_match(self, preop, col, exp, field_tokens): # , fts_tokens):
|
|
107
|
+
col = ALIAS_FIELD_MAP.get(col, col)
|
|
108
|
+
if col not in _VALID_COLUMNS:
|
|
109
|
+
return True
|
|
110
|
+
if col == "path" and not self._is_path_column_allowed():
|
|
111
|
+
return True
|
|
112
|
+
if col in _NON_FTS_COLUMNS or self._is_column_operators_used(exp):
|
|
113
|
+
if not preop:
|
|
114
|
+
preop = "and"
|
|
115
|
+
if preop not in field_tokens:
|
|
116
|
+
field_tokens[preop] = set()
|
|
117
|
+
field_tokens[preop].add((col, exp))
|
|
118
|
+
return True
|
|
119
|
+
|
|
120
|
+
return False
|
|
121
|
+
|
|
122
|
+
@staticmethod
|
|
123
|
+
def _add_fts_token(fts_tokens, token):
|
|
124
|
+
token = _FTS_OPERATOR_RE.sub(lambda op: op.group("operator").upper(), token)
|
|
125
|
+
if (
|
|
126
|
+
token.lower() not in _FTS_OPERATORS
|
|
127
|
+
and not (token.startswith('"') and token.endswith('"'))
|
|
128
|
+
and ":" not in token
|
|
129
|
+
):
|
|
130
|
+
token = f'"{token}"'
|
|
131
|
+
fts_tokens.append(token)
|
|
132
|
+
|
|
133
|
+
def _preparse_search_query_token(self, match, field_tokens, fts_tokens):
|
|
134
|
+
token = match.group("token")
|
|
135
|
+
if not token:
|
|
136
|
+
return
|
|
137
|
+
|
|
138
|
+
multi_col = match.group("multi_col")
|
|
139
|
+
col = match.group("col")
|
|
140
|
+
exp = match.group("exp")
|
|
141
|
+
if multi_col or not col or not exp:
|
|
142
|
+
# I could add multi-col to field groups, but nobody will care.
|
|
143
|
+
self._add_fts_token(fts_tokens, token)
|
|
144
|
+
return
|
|
145
|
+
|
|
146
|
+
preop = match.group("preop")
|
|
147
|
+
if not self._parse_column_match(preop, col, exp, field_tokens):
|
|
148
|
+
self._add_fts_token(fts_tokens, token)
|
|
149
|
+
|
|
150
|
+
def _preparse_search_query(self):
|
|
151
|
+
"""Preparse search fields out of query text."""
|
|
152
|
+
text = self.params.get("q") # type: ignore
|
|
153
|
+
field_tokens = {}
|
|
154
|
+
if not text:
|
|
155
|
+
return field_tokens, text
|
|
156
|
+
|
|
157
|
+
fts_tokens = []
|
|
158
|
+
for match in _TOKEN_RE.finditer(text):
|
|
159
|
+
try:
|
|
160
|
+
self._preparse_search_query_token(match, field_tokens, fts_tokens)
|
|
161
|
+
except Exception as exc:
|
|
162
|
+
tok = match.group(0) if match else "<unmatched>"
|
|
163
|
+
LOG.debug(f"Error preparsing search query token {tok}: {exc}")
|
|
164
|
+
self.search_error = "Syntax error"
|
|
165
|
+
text = " ".join(fts_tokens)
|
|
166
|
+
|
|
167
|
+
return field_tokens, text
|
|
168
|
+
|
|
169
|
+
def _create_search_filters(self, model):
|
|
170
|
+
field_tokens_dict, fts_text = self._preparse_search_query()
|
|
171
|
+
field_filter_q_list = []
|
|
172
|
+
field_exclude_q_list = []
|
|
173
|
+
for preop, field_token_pairs in field_tokens_dict.items():
|
|
174
|
+
if preop == "not":
|
|
175
|
+
exclude_q_list, include_q_list = self.get_search_field_filters(
|
|
176
|
+
model, field_token_pairs
|
|
177
|
+
)
|
|
178
|
+
else:
|
|
179
|
+
# AND and OR
|
|
180
|
+
# XXX cannot do OR queries with MATCH, it decontextualizes MATCH somehow.
|
|
181
|
+
if preop == "or":
|
|
182
|
+
self.search_error = "OR preceding column tokens with operator expressions will act as AND"
|
|
183
|
+
include_q_list, exclude_q_list = self.get_search_field_filters(
|
|
184
|
+
model, field_token_pairs
|
|
185
|
+
)
|
|
186
|
+
field_filter_q_list += include_q_list
|
|
187
|
+
field_exclude_q_list += exclude_q_list
|
|
188
|
+
|
|
189
|
+
fts_filter_dict = self.get_fts_filter(model, fts_text)
|
|
190
|
+
if fts_filter_dict:
|
|
191
|
+
self.fts_mode = True
|
|
192
|
+
fts_q = Q(**fts_filter_dict)
|
|
193
|
+
else:
|
|
194
|
+
fts_q = Q()
|
|
195
|
+
|
|
196
|
+
return field_filter_q_list, field_exclude_q_list, fts_q
|
|
197
|
+
|
|
198
|
+
def _create_search_filter(self, filter_list):
|
|
199
|
+
"""Apply search filter lists. Separate filter clauses are employed for m2m searches."""
|
|
200
|
+
combined_q = Q()
|
|
201
|
+
for q in filter_list:
|
|
202
|
+
if not q:
|
|
203
|
+
continue
|
|
204
|
+
combined_q &= q
|
|
205
|
+
self.search_mode = True
|
|
206
|
+
|
|
207
|
+
return combined_q
|
|
208
|
+
|
|
209
|
+
def get_search_filters(self, model):
|
|
210
|
+
"""Preparse search, search and return the filter and scores."""
|
|
211
|
+
include_q = Q()
|
|
212
|
+
exclude_q = Q()
|
|
213
|
+
fts_q = Q()
|
|
214
|
+
try:
|
|
215
|
+
field_filter_q_list, field_exclude_q_list, fts_q = (
|
|
216
|
+
self._create_search_filters(model)
|
|
217
|
+
)
|
|
218
|
+
# Apply filters
|
|
219
|
+
include_q = self._create_search_filter(field_filter_q_list)
|
|
220
|
+
exclude_q = self._create_search_filter(field_exclude_q_list)
|
|
221
|
+
|
|
222
|
+
except Exception as exc:
|
|
223
|
+
msg = "Creating search filters"
|
|
224
|
+
LOG.exception(msg)
|
|
225
|
+
msg = f"{msg} - {exc}"
|
|
226
|
+
self.search_error = msg
|
|
227
|
+
|
|
228
|
+
return include_q, exclude_q, fts_q
|
|
229
|
+
|
|
230
|
+
def _is_search_results_limited(self) -> bool:
|
|
231
|
+
"""Get search result limit from params."""
|
|
232
|
+
# user = self.request.user # type: ignore
|
|
233
|
+
# if user and user.is_authenticated:
|
|
234
|
+
# limited = bool(
|
|
235
|
+
# self.params.get( # type: ignore
|
|
236
|
+
# "search_results_limit",
|
|
237
|
+
# MAX_OBJ_PER_PAGE,
|
|
238
|
+
# )
|
|
239
|
+
# )
|
|
240
|
+
# else:
|
|
241
|
+
# limited = True
|
|
242
|
+
# return limited
|
|
243
|
+
return True
|
|
244
|
+
|
|
245
|
+
def get_search_limit(self):
|
|
246
|
+
"""Get search scores for choices and metadata."""
|
|
247
|
+
if not self.search_mode or not self._is_search_results_limited():
|
|
248
|
+
return 0
|
|
249
|
+
page = self.kwargs.get("page", 1) # type: ignore
|
|
250
|
+
return page * MAX_OBJ_PER_PAGE + 1
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"""Group Mtime Function."""
|
|
2
|
+
|
|
3
|
+
from logging import DEBUG, WARNING
|
|
4
|
+
|
|
5
|
+
from django.db.models.aggregates import Aggregate, Max
|
|
6
|
+
from django.db.models.functions import Greatest
|
|
7
|
+
from django.db.utils import OperationalError
|
|
8
|
+
|
|
9
|
+
from codex.logger.logging import get_logger
|
|
10
|
+
from codex.models.functions import JsonGroupArray
|
|
11
|
+
from codex.views.browser.filters.filter import BrowserFilterView
|
|
12
|
+
from codex.views.const import EPOCH_START, EPOCH_START_DATETIMEFIELD, NONE_DATETIMEFIELD
|
|
13
|
+
|
|
14
|
+
_FTS5_PREFIX = "fts5: "
|
|
15
|
+
LOG = get_logger(__name__)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class BrowserGroupMtimeView(BrowserFilterView):
|
|
19
|
+
"""Annotations that also filter."""
|
|
20
|
+
|
|
21
|
+
def __init__(self, *args, **kwargs):
|
|
22
|
+
"""Initialize memoized values."""
|
|
23
|
+
super().__init__(*args, **kwargs)
|
|
24
|
+
self._is_bookmark_filtered: bool | None = None
|
|
25
|
+
|
|
26
|
+
@property
|
|
27
|
+
def is_bookmark_filtered(self):
|
|
28
|
+
"""Is bookmark filter in effect."""
|
|
29
|
+
if self._is_bookmark_filtered is None:
|
|
30
|
+
self._is_bookmark_filtered = bool(
|
|
31
|
+
self.params.get("filters", {}).get("bookmark")
|
|
32
|
+
)
|
|
33
|
+
return self._is_bookmark_filtered
|
|
34
|
+
|
|
35
|
+
def _handle_operational_error(self, err):
|
|
36
|
+
msg = err.args[0] if err.args else ""
|
|
37
|
+
if msg.startswith(_FTS5_PREFIX):
|
|
38
|
+
level = DEBUG
|
|
39
|
+
self.search_error = msg.removeprefix(_FTS5_PREFIX)
|
|
40
|
+
else:
|
|
41
|
+
level = WARNING
|
|
42
|
+
msg = str(err)
|
|
43
|
+
LOG.log(level, f"Query Error: {msg}")
|
|
44
|
+
|
|
45
|
+
def get_max_bookmark_updated_at_aggregate(
|
|
46
|
+
self, model, agg_func: type[Aggregate] = Max, default=NONE_DATETIMEFIELD
|
|
47
|
+
):
|
|
48
|
+
"""Get filtered maximum bookmark updated_at relation."""
|
|
49
|
+
bm_rel = self._get_bm_rel(model)
|
|
50
|
+
bm_filter = self._get_my_bookmark_filter(bm_rel)
|
|
51
|
+
bmua_rel = f"{bm_rel}__updated_at"
|
|
52
|
+
args = {"default": default, "filter": bm_filter}
|
|
53
|
+
if agg_func is JsonGroupArray:
|
|
54
|
+
args["distinct"] = True
|
|
55
|
+
return agg_func(bmua_rel, **args)
|
|
56
|
+
|
|
57
|
+
def get_group_mtime(self, model, group=None, pks=None, page_mtime=False):
|
|
58
|
+
"""Get a filtered mtime for browser pages and mtime checker."""
|
|
59
|
+
qs = self.get_filtered_queryset(
|
|
60
|
+
model,
|
|
61
|
+
group=group,
|
|
62
|
+
pks=pks,
|
|
63
|
+
page_mtime=page_mtime,
|
|
64
|
+
bookmark_filter=self.is_bookmark_filtered,
|
|
65
|
+
)
|
|
66
|
+
mua = Max("updated_at", default=EPOCH_START_DATETIMEFIELD)
|
|
67
|
+
mbua = self.get_max_bookmark_updated_at_aggregate(
|
|
68
|
+
model, default=EPOCH_START_DATETIMEFIELD
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
try:
|
|
72
|
+
qs = qs.annotate(max=Greatest(mua, mbua))
|
|
73
|
+
# Forcing inner joins makes search work
|
|
74
|
+
# Can't run demote_joins on aggregate.
|
|
75
|
+
qs = self.force_inner_joins(qs)
|
|
76
|
+
first = qs.first()
|
|
77
|
+
mtime = first.max if first else EPOCH_START
|
|
78
|
+
except OperationalError as exc:
|
|
79
|
+
self._handle_operational_error(exc)
|
|
80
|
+
mtime = None
|
|
81
|
+
if mtime == NotImplemented:
|
|
82
|
+
mtime = None
|
|
83
|
+
return mtime
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Metadata View."""
|