codex 1.6.19__py3-none-any.whl → 1.7.0a0__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/db.py +119 -0
- codex/librarian/covers/purge.py +1 -1
- 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 +369 -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 +32 -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/observers.py +2 -1
- codex/migrations/0029_comicfts.py +58 -0
- codex/migrations/0030_nocase_collation_day_month_indexes_status_types.py +198 -0
- codex/models/admin.py +15 -6
- codex/models/base.py +9 -0
- codex/models/bookmark.py +3 -3
- codex/models/comic.py +68 -16
- codex/models/functions.py +59 -2
- codex/models/groups.py +6 -1
- codex/models/library.py +1 -3
- codex/models/paths.py +9 -3
- codex/serializers/browser/page.py +2 -0
- codex/settings/settings.py +16 -17
- codex/signals/django_signals.py +4 -10
- codex/startup.py +1 -35
- codex/static_root/assets/{VCheckbox-Cko1sQK-.170726b3b8a1.js → VCheckbox-CWiqcZ7a.3feebd47daab.js} +1 -1
- codex/static_root/assets/VCheckbox-CWiqcZ7a.3feebd47daab.js.br +0 -0
- codex/static_root/assets/VCheckbox-CWiqcZ7a.3feebd47daab.js.gz +0 -0
- codex/static_root/assets/{VCheckbox-Cko1sQK-.js → VCheckbox-CWiqcZ7a.js} +1 -1
- codex/static_root/assets/VCheckbox-CWiqcZ7a.js.br +0 -0
- codex/static_root/assets/VCheckbox-CWiqcZ7a.js.gz +0 -0
- codex/static_root/assets/{VCheckboxBtn-CO3-aqQL.c9b8062fd66f.js → VCheckboxBtn-Dk3iB62X.bc66d5351baa.js} +1 -1
- codex/static_root/assets/VCheckboxBtn-Dk3iB62X.bc66d5351baa.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-Dk3iB62X.bc66d5351baa.js.gz +0 -0
- codex/static_root/assets/{VCheckboxBtn-CO3-aqQL.js → VCheckboxBtn-Dk3iB62X.js} +1 -1
- codex/static_root/assets/VCheckboxBtn-Dk3iB62X.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-Dk3iB62X.js.gz +0 -0
- codex/static_root/assets/{VCombobox-Bjp6lffE.js → VCombobox-D1_KU27A.b1d30587a973.js} +1 -1
- codex/static_root/assets/VCombobox-D1_KU27A.b1d30587a973.js.br +0 -0
- codex/static_root/assets/VCombobox-D1_KU27A.b1d30587a973.js.gz +0 -0
- codex/static_root/assets/{VCombobox-Bjp6lffE.caf59fba486e.js → VCombobox-D1_KU27A.js} +1 -1
- codex/static_root/assets/VCombobox-D1_KU27A.js.br +0 -0
- codex/static_root/assets/VCombobox-D1_KU27A.js.gz +0 -0
- codex/static_root/assets/{VDialog-BkpVGB70.6eea3ca762a5.js → VDialog-GbxvFMMN.594fb3a39ced.js} +1 -1
- codex/static_root/assets/VDialog-GbxvFMMN.594fb3a39ced.js.br +0 -0
- codex/static_root/assets/VDialog-GbxvFMMN.594fb3a39ced.js.gz +0 -0
- codex/static_root/assets/{VDialog-BkpVGB70.js → VDialog-GbxvFMMN.js} +1 -1
- codex/static_root/assets/VDialog-GbxvFMMN.js.br +0 -0
- codex/static_root/assets/VDialog-GbxvFMMN.js.gz +0 -0
- codex/static_root/assets/{VExpansionPanels-Ci2-j8XX.9c55db4ef49e.js → VExpansionPanels-Cywv_bEj.a762e63858e5.js} +1 -1
- codex/static_root/assets/VExpansionPanels-Cywv_bEj.a762e63858e5.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-Cywv_bEj.a762e63858e5.js.gz +0 -0
- codex/static_root/assets/{VExpansionPanels-Ci2-j8XX.js → VExpansionPanels-Cywv_bEj.js} +1 -1
- codex/static_root/assets/VExpansionPanels-Cywv_bEj.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-Cywv_bEj.js.gz +0 -0
- codex/static_root/assets/{VRadioGroup-D3Py5BfQ.a4f25edb86d3.js → VRadioGroup-C0etmxpZ.0eb3009a6300.js} +1 -1
- codex/static_root/assets/VRadioGroup-C0etmxpZ.0eb3009a6300.js.br +0 -0
- codex/static_root/assets/VRadioGroup-C0etmxpZ.0eb3009a6300.js.gz +0 -0
- codex/static_root/assets/{VRadioGroup-D3Py5BfQ.js → VRadioGroup-C0etmxpZ.js} +1 -1
- codex/static_root/assets/VRadioGroup-C0etmxpZ.js.br +0 -0
- codex/static_root/assets/VRadioGroup-C0etmxpZ.js.gz +0 -0
- codex/static_root/assets/{VSelect-DtvZsYZz.e98745d858eb.js → VSelect-txrnRiNJ.a5625760018c.js} +1 -1
- codex/static_root/assets/VSelect-txrnRiNJ.a5625760018c.js.br +0 -0
- codex/static_root/assets/VSelect-txrnRiNJ.a5625760018c.js.gz +0 -0
- codex/static_root/assets/{VSelect-DtvZsYZz.js → VSelect-txrnRiNJ.js} +1 -1
- codex/static_root/assets/VSelect-txrnRiNJ.js.br +0 -0
- codex/static_root/assets/VSelect-txrnRiNJ.js.gz +0 -0
- codex/static_root/assets/{VSelectionControl-D6kmykQW.1e1fda62ceba.js → VSelectionControl-CY6RmcvW.7e8824224f6c.js} +1 -1
- codex/static_root/assets/VSelectionControl-CY6RmcvW.7e8824224f6c.js.br +0 -0
- codex/static_root/assets/VSelectionControl-CY6RmcvW.7e8824224f6c.js.gz +0 -0
- codex/static_root/assets/{VSelectionControl-D6kmykQW.js → VSelectionControl-CY6RmcvW.js} +1 -1
- codex/static_root/assets/VSelectionControl-CY6RmcvW.js.br +0 -0
- codex/static_root/assets/VSelectionControl-CY6RmcvW.js.gz +0 -0
- codex/static_root/assets/{VSlideGroup-UGZWxpF5.360bdefcd215.js → VSlideGroup-DtEQMwY1.6c72325635ed.js} +1 -1
- codex/static_root/assets/VSlideGroup-DtEQMwY1.6c72325635ed.js.br +0 -0
- codex/static_root/assets/VSlideGroup-DtEQMwY1.6c72325635ed.js.gz +0 -0
- codex/static_root/assets/{VSlideGroup-UGZWxpF5.js → VSlideGroup-DtEQMwY1.js} +1 -1
- codex/static_root/assets/VSlideGroup-DtEQMwY1.js.br +0 -0
- codex/static_root/assets/VSlideGroup-DtEQMwY1.js.gz +0 -0
- codex/static_root/assets/{VTable-DXH_yQ0o.1149f56ad566.js → VTable-2af995xo.6c5bf36631b2.js} +1 -1
- codex/static_root/assets/VTable-2af995xo.6c5bf36631b2.js.br +0 -0
- codex/static_root/assets/VTable-2af995xo.6c5bf36631b2.js.gz +0 -0
- codex/static_root/assets/{VTable-DXH_yQ0o.js → VTable-2af995xo.js} +1 -1
- codex/static_root/assets/VTable-2af995xo.js.br +0 -0
- codex/static_root/assets/VTable-2af995xo.js.gz +0 -0
- codex/static_root/assets/{VTextField-Blqy56_L.26d8761e0155.js → VTextField-G6CMj7yO.657a130dd302.js} +1 -1
- codex/static_root/assets/VTextField-G6CMj7yO.657a130dd302.js.br +0 -0
- codex/static_root/assets/VTextField-G6CMj7yO.657a130dd302.js.gz +0 -0
- codex/static_root/assets/{VTextField-Blqy56_L.js → VTextField-G6CMj7yO.js} +1 -1
- codex/static_root/assets/VTextField-G6CMj7yO.js.br +0 -0
- codex/static_root/assets/VTextField-G6CMj7yO.js.gz +0 -0
- codex/static_root/assets/{VWindowItem-C8_ovV7e.afbc08414765.js → VWindowItem-CzoGd6Ul.721e5da11ad4.js} +1 -1
- codex/static_root/assets/VWindowItem-CzoGd6Ul.721e5da11ad4.js.br +0 -0
- codex/static_root/assets/VWindowItem-CzoGd6Ul.721e5da11ad4.js.gz +0 -0
- codex/static_root/assets/{VWindowItem-C8_ovV7e.js → VWindowItem-CzoGd6Ul.js} +1 -1
- codex/static_root/assets/VWindowItem-CzoGd6Ul.js.br +0 -0
- codex/static_root/assets/VWindowItem-CzoGd6Ul.js.gz +0 -0
- codex/static_root/assets/{admin-DTRn8bBs.d031ea42d8d0.js → admin-CsPAIQeG.5175467148a3.js} +1 -1
- codex/static_root/assets/admin-CsPAIQeG.5175467148a3.js.br +0 -0
- codex/static_root/assets/admin-CsPAIQeG.5175467148a3.js.gz +0 -0
- codex/static_root/assets/{admin-DTRn8bBs.js → admin-CsPAIQeG.js} +1 -1
- codex/static_root/assets/admin-CsPAIQeG.js.br +0 -0
- codex/static_root/assets/admin-CsPAIQeG.js.gz +0 -0
- codex/static_root/assets/{admin-drawer-panel-BaXFOcru.b1a44b05f482.js → admin-drawer-panel-BAT7GA64.73a064628c19.js} +11 -11
- codex/static_root/assets/admin-drawer-panel-BAT7GA64.73a064628c19.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-BAT7GA64.73a064628c19.js.gz +0 -0
- codex/static_root/assets/{admin-drawer-panel-BaXFOcru.js → admin-drawer-panel-BAT7GA64.js} +11 -11
- codex/static_root/assets/admin-drawer-panel-BAT7GA64.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-BAT7GA64.js.gz +0 -0
- codex/static_root/assets/browser-C18l93yc.923860009ef4.js +1 -0
- codex/static_root/assets/browser-C18l93yc.923860009ef4.js.br +0 -0
- codex/static_root/assets/browser-C18l93yc.923860009ef4.js.gz +0 -0
- codex/static_root/assets/browser-C18l93yc.js +1 -0
- codex/static_root/assets/browser-C18l93yc.js.br +0 -0
- codex/static_root/assets/browser-C18l93yc.js.gz +0 -0
- codex/static_root/assets/browser-DaAqlBYO.708ecf0904bb.css +1 -0
- codex/static_root/assets/browser-DaAqlBYO.708ecf0904bb.css.br +0 -0
- codex/static_root/assets/browser-DaAqlBYO.708ecf0904bb.css.gz +0 -0
- codex/static_root/assets/browser-DaAqlBYO.css +1 -0
- codex/static_root/assets/browser-DaAqlBYO.css.br +0 -0
- codex/static_root/assets/browser-DaAqlBYO.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-BazJdNs9.0a4e02656a35.js +1 -0
- codex/static_root/assets/change-password-dialog-BazJdNs9.0a4e02656a35.js.br +0 -0
- codex/static_root/assets/change-password-dialog-BazJdNs9.0a4e02656a35.js.gz +0 -0
- codex/static_root/assets/change-password-dialog-BazJdNs9.js +1 -0
- codex/static_root/assets/change-password-dialog-BazJdNs9.js.br +0 -0
- codex/static_root/assets/change-password-dialog-BazJdNs9.js.gz +0 -0
- codex/static_root/assets/change-password-dialog-Mlmvz8_4.111421f51e79.css +1 -0
- codex/static_root/assets/change-password-dialog-Mlmvz8_4.111421f51e79.css.br +0 -0
- codex/static_root/assets/change-password-dialog-Mlmvz8_4.111421f51e79.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-Mlmvz8_4.css +1 -0
- codex/static_root/assets/change-password-dialog-Mlmvz8_4.css.br +0 -0
- codex/static_root/assets/change-password-dialog-Mlmvz8_4.css.gz +0 -0
- codex/static_root/assets/{confirm-dialog-D3_s2DQy.9dde66036c72.js → confirm-dialog-CbW3hlOp.9dd39b443c31.js} +1 -1
- codex/static_root/assets/confirm-dialog-CbW3hlOp.9dd39b443c31.js.br +0 -0
- codex/static_root/assets/confirm-dialog-CbW3hlOp.9dd39b443c31.js.gz +0 -0
- codex/static_root/assets/{confirm-dialog-D3_s2DQy.js → confirm-dialog-CbW3hlOp.js} +1 -1
- codex/static_root/assets/confirm-dialog-CbW3hlOp.js.br +0 -0
- codex/static_root/assets/confirm-dialog-CbW3hlOp.js.gz +0 -0
- codex/static_root/assets/{datetime-column-BxC1Li9e.3dc314b3295d.js → datetime-column-uSqKZU37.b157b0743db5.js} +1 -1
- codex/static_root/assets/datetime-column-uSqKZU37.b157b0743db5.js.br +0 -0
- codex/static_root/assets/datetime-column-uSqKZU37.b157b0743db5.js.gz +0 -0
- codex/static_root/assets/{datetime-column-BxC1Li9e.js → datetime-column-uSqKZU37.js} +1 -1
- codex/static_root/assets/datetime-column-uSqKZU37.js.br +0 -0
- codex/static_root/assets/datetime-column-uSqKZU37.js.gz +0 -0
- codex/static_root/assets/{filter-Bzk7x841.d0c3b602e62d.js → filter-CBl5KEsB.845a81573c2e.js} +1 -1
- codex/static_root/assets/filter-CBl5KEsB.845a81573c2e.js.br +0 -0
- codex/static_root/assets/filter-CBl5KEsB.845a81573c2e.js.gz +0 -0
- codex/static_root/assets/{filter-Bzk7x841.js → filter-CBl5KEsB.js} +1 -1
- codex/static_root/assets/filter-CBl5KEsB.js.br +0 -0
- codex/static_root/assets/filter-CBl5KEsB.js.gz +0 -0
- codex/static_root/assets/flag-tab-CT8pqM4r.ecb6eee2e7a0.js +1 -0
- codex/static_root/assets/flag-tab-CT8pqM4r.ecb6eee2e7a0.js.br +0 -0
- codex/static_root/assets/flag-tab-CT8pqM4r.ecb6eee2e7a0.js.gz +0 -0
- codex/static_root/assets/flag-tab-CT8pqM4r.js +1 -0
- codex/static_root/assets/flag-tab-CT8pqM4r.js.br +0 -0
- codex/static_root/assets/flag-tab-CT8pqM4r.js.gz +0 -0
- codex/static_root/assets/{group-tab-5esH4lwX.a81fdd258117.js → group-tab-BOW9kigw.7e5007596367.js} +1 -1
- codex/static_root/assets/group-tab-BOW9kigw.7e5007596367.js.br +0 -0
- codex/static_root/assets/group-tab-BOW9kigw.7e5007596367.js.gz +0 -0
- codex/static_root/assets/{group-tab-5esH4lwX.js → group-tab-BOW9kigw.js} +1 -1
- codex/static_root/assets/group-tab-BOW9kigw.js.br +0 -0
- codex/static_root/assets/group-tab-BOW9kigw.js.gz +0 -0
- codex/static_root/assets/{http-error-BTOBfcGY.52ced6f28420.js → http-error-C6yuLApo.45cf99eb7a70.js} +1 -1
- codex/static_root/assets/http-error-C6yuLApo.45cf99eb7a70.js.br +4 -0
- codex/static_root/assets/http-error-C6yuLApo.45cf99eb7a70.js.gz +0 -0
- codex/static_root/assets/{http-error-BTOBfcGY.js → http-error-C6yuLApo.js} +1 -1
- codex/static_root/assets/http-error-C6yuLApo.js.br +4 -0
- codex/static_root/assets/http-error-C6yuLApo.js.gz +0 -0
- codex/static_root/assets/{library-tab-DiPEdOF7.ece2d642a9dc.js → library-tab-D3WOtpE0.9af34e6e7235.js} +1 -1
- codex/static_root/assets/library-tab-D3WOtpE0.9af34e6e7235.js.br +0 -0
- codex/static_root/assets/library-tab-D3WOtpE0.9af34e6e7235.js.gz +0 -0
- codex/static_root/assets/{library-tab-DiPEdOF7.js → library-tab-D3WOtpE0.js} +1 -1
- codex/static_root/assets/library-tab-D3WOtpE0.js.br +0 -0
- codex/static_root/assets/library-tab-D3WOtpE0.js.gz +0 -0
- codex/static_root/assets/main-CmjU2oTp.6a471f6900e5.js +6 -0
- codex/static_root/assets/main-CmjU2oTp.6a471f6900e5.js.br +0 -0
- codex/static_root/assets/main-CmjU2oTp.6a471f6900e5.js.gz +0 -0
- codex/static_root/assets/main-CmjU2oTp.js +6 -0
- codex/static_root/assets/main-CmjU2oTp.js.br +0 -0
- codex/static_root/assets/main-CmjU2oTp.js.gz +0 -0
- codex/static_root/assets/pager-full-pdf-BH54_5f6.6e92d0555cd7.js +1 -0
- codex/static_root/assets/pager-full-pdf-BH54_5f6.6e92d0555cd7.js.br +0 -0
- codex/static_root/assets/pager-full-pdf-BH54_5f6.6e92d0555cd7.js.gz +0 -0
- codex/static_root/assets/pager-full-pdf-BH54_5f6.js +1 -0
- codex/static_root/assets/pager-full-pdf-BH54_5f6.js.br +0 -0
- codex/static_root/assets/pager-full-pdf-BH54_5f6.js.gz +0 -0
- codex/static_root/assets/{pagination-toolbar-C45-onwe.4722195bb60b.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-C45-onwe.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/{pagination-toolbar-CkIzuyx1.00c354a82e6e.js → pagination-toolbar-JH3Kbffr.451171f7ac33.js} +1 -1
- codex/static_root/assets/pagination-toolbar-JH3Kbffr.451171f7ac33.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-JH3Kbffr.451171f7ac33.js.gz +0 -0
- codex/static_root/assets/{pagination-toolbar-CkIzuyx1.js → pagination-toolbar-JH3Kbffr.js} +1 -1
- codex/static_root/assets/pagination-toolbar-JH3Kbffr.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-JH3Kbffr.js.gz +0 -0
- codex/static_root/assets/{pdf-doc-BjlRPuf4.0f056fa321b6.js → pdf-doc-BcRNpoaW.882f6e967869.js} +1 -1
- codex/static_root/assets/pdf-doc-BcRNpoaW.882f6e967869.js.br +0 -0
- codex/static_root/assets/pdf-doc-BcRNpoaW.882f6e967869.js.gz +0 -0
- codex/static_root/assets/{pdf-doc-BjlRPuf4.js → pdf-doc-BcRNpoaW.js} +1 -1
- codex/static_root/assets/pdf-doc-BcRNpoaW.js.br +0 -0
- codex/static_root/assets/pdf-doc-BcRNpoaW.js.gz +0 -0
- codex/static_root/assets/reader-DIPRg2VB.900370e097aa.js +2 -0
- codex/static_root/assets/reader-DIPRg2VB.900370e097aa.js.br +0 -0
- codex/static_root/assets/reader-DIPRg2VB.900370e097aa.js.gz +0 -0
- codex/static_root/assets/reader-DIPRg2VB.js +2 -0
- codex/static_root/assets/reader-DIPRg2VB.js.br +0 -0
- codex/static_root/assets/reader-DIPRg2VB.js.gz +0 -0
- codex/static_root/assets/reader-DveZZr9x.7b21b9f8f628.css +1 -0
- codex/static_root/assets/reader-DveZZr9x.7b21b9f8f628.css.br +0 -0
- codex/static_root/assets/reader-DveZZr9x.7b21b9f8f628.css.gz +0 -0
- codex/static_root/assets/reader-DveZZr9x.css +1 -0
- codex/static_root/assets/reader-DveZZr9x.css.br +0 -0
- codex/static_root/assets/reader-DveZZr9x.css.gz +0 -0
- codex/static_root/assets/{relation-chips-CUSatZET.js → relation-chips-3tTlR5QH.71f18bc92adc.js} +1 -1
- codex/static_root/assets/relation-chips-3tTlR5QH.71f18bc92adc.js.br +0 -0
- codex/static_root/assets/relation-chips-3tTlR5QH.71f18bc92adc.js.gz +0 -0
- codex/static_root/assets/{relation-chips-CUSatZET.a58031ff8141.js → relation-chips-3tTlR5QH.js} +1 -1
- codex/static_root/assets/relation-chips-3tTlR5QH.js.br +0 -0
- codex/static_root/assets/relation-chips-3tTlR5QH.js.gz +0 -0
- codex/static_root/assets/{settings-drawer-BSHTAsJ9.js → settings-drawer-BdyFhA_r.151f4c3061ed.js} +2 -2
- codex/static_root/assets/settings-drawer-BdyFhA_r.151f4c3061ed.js.br +0 -0
- codex/static_root/assets/settings-drawer-BdyFhA_r.151f4c3061ed.js.gz +0 -0
- codex/static_root/assets/{settings-drawer-BSHTAsJ9.1d07ce084fc9.js → settings-drawer-BdyFhA_r.js} +2 -2
- codex/static_root/assets/settings-drawer-BdyFhA_r.js.br +0 -0
- codex/static_root/assets/settings-drawer-BdyFhA_r.js.gz +0 -0
- codex/static_root/assets/stats-tab-DeKjwvmh.7557c71b4cfa.js +1 -0
- codex/static_root/assets/stats-tab-DeKjwvmh.7557c71b4cfa.js.br +0 -0
- codex/static_root/assets/stats-tab-DeKjwvmh.7557c71b4cfa.js.gz +0 -0
- codex/static_root/assets/stats-tab-DeKjwvmh.js +1 -0
- codex/static_root/assets/stats-tab-DeKjwvmh.js.br +0 -0
- codex/static_root/assets/stats-tab-DeKjwvmh.js.gz +0 -0
- codex/static_root/assets/{stats-tab-BXGisn5N.9b7a71e7fe28.css → stats-tab-DpfGsVX3.1cb66f2649a9.css} +1 -1
- codex/static_root/assets/stats-tab-DpfGsVX3.1cb66f2649a9.css.br +0 -0
- codex/static_root/assets/stats-tab-DpfGsVX3.1cb66f2649a9.css.gz +0 -0
- codex/static_root/assets/{stats-tab-BXGisn5N.css → stats-tab-DpfGsVX3.css} +1 -1
- codex/static_root/assets/stats-tab-DpfGsVX3.css.br +0 -0
- codex/static_root/assets/stats-tab-DpfGsVX3.css.gz +0 -0
- codex/static_root/assets/{task-tab-NORFAa9p.97e07e366ddd.js → task-tab-C8D0qRP_.d4ab174c69a3.js} +1 -1
- codex/static_root/assets/task-tab-C8D0qRP_.d4ab174c69a3.js.br +0 -0
- codex/static_root/assets/task-tab-C8D0qRP_.d4ab174c69a3.js.gz +0 -0
- codex/static_root/assets/{task-tab-NORFAa9p.js → task-tab-C8D0qRP_.js} +1 -1
- codex/static_root/assets/task-tab-C8D0qRP_.js.br +0 -0
- codex/static_root/assets/task-tab-C8D0qRP_.js.gz +0 -0
- codex/static_root/assets/unauthorized-BHgBRF4z.8e5c1b9e52b0.js +1 -0
- codex/static_root/assets/unauthorized-BHgBRF4z.8e5c1b9e52b0.js.br +0 -0
- codex/static_root/assets/unauthorized-BHgBRF4z.8e5c1b9e52b0.js.gz +0 -0
- codex/static_root/assets/unauthorized-BHgBRF4z.js +1 -0
- codex/static_root/assets/unauthorized-BHgBRF4z.js.br +0 -0
- codex/static_root/assets/unauthorized-BHgBRF4z.js.gz +0 -0
- codex/static_root/assets/{unauthorized-muDsv-rC.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.2166ec8b3a32.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/{user-tab-CHbyN1EW.e7206db08680.js → user-tab-BU31Z92y.35613c713faf.js} +1 -1
- codex/static_root/assets/user-tab-BU31Z92y.35613c713faf.js.br +0 -0
- codex/static_root/assets/user-tab-BU31Z92y.35613c713faf.js.gz +0 -0
- codex/static_root/assets/{user-tab-CHbyN1EW.js → user-tab-BU31Z92y.js} +1 -1
- codex/static_root/assets/user-tab-BU31Z92y.js.br +0 -0
- codex/static_root/assets/user-tab-BU31Z92y.js.gz +0 -0
- codex/static_root/js/choices-admin.8aa64c911203.json +1 -0
- codex/static_root/js/choices-admin.8aa64c911203.json.br +0 -0
- codex/static_root/js/choices-admin.8aa64c911203.json.gz +0 -0
- codex/static_root/js/choices-admin.json +1 -1
- codex/static_root/js/choices-admin.json.br +0 -0
- codex/static_root/js/choices-admin.json.gz +0 -0
- codex/static_root/manifest.45cb46e19686.json +635 -0
- codex/static_root/manifest.45cb46e19686.json.br +0 -0
- codex/static_root/manifest.45cb46e19686.json.gz +0 -0
- codex/static_root/manifest.json +248 -248
- 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 +10 -4
- codex/views/admin/tasks.py +46 -40
- codex/views/auth.py +15 -4
- codex/views/browser/annotations.py +94 -51
- codex/views/browser/base.py +1 -2
- codex/views/browser/browser.py +52 -21
- codex/views/browser/cover.py +8 -4
- codex/views/browser/filters/annotations.py +28 -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 +38 -0
- codex/views/browser/filters/search/parse.py +220 -0
- codex/views/browser/order_by.py +8 -2
- codex/views/browser/page_in_bounds.py +88 -0
- codex/views/browser/paginate.py +28 -113
- codex/views/const.py +0 -1
- codex/views/opds/v1/feed.py +2 -1
- codex/views/opds/v2/feed.py +2 -1
- codex/views/opds/v2/links.py +1 -1
- codex/views/reader/books.py +1 -1
- codex/views/reader/page.py +3 -3
- {codex-1.6.19.dist-info → codex-1.7.0a0.dist-info}/METADATA +18 -10
- {codex-1.6.19.dist-info → codex-1.7.0a0.dist-info}/RECORD +321 -372
- 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/static_root/assets/VCheckbox-Cko1sQK-.170726b3b8a1.js.br +0 -0
- codex/static_root/assets/VCheckbox-Cko1sQK-.170726b3b8a1.js.gz +0 -0
- codex/static_root/assets/VCheckbox-Cko1sQK-.js.br +0 -0
- codex/static_root/assets/VCheckbox-Cko1sQK-.js.gz +0 -0
- codex/static_root/assets/VCheckboxBtn-CO3-aqQL.c9b8062fd66f.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-CO3-aqQL.c9b8062fd66f.js.gz +0 -0
- codex/static_root/assets/VCheckboxBtn-CO3-aqQL.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-CO3-aqQL.js.gz +0 -0
- codex/static_root/assets/VCombobox-Bjp6lffE.caf59fba486e.js.br +0 -0
- codex/static_root/assets/VCombobox-Bjp6lffE.caf59fba486e.js.gz +0 -0
- codex/static_root/assets/VCombobox-Bjp6lffE.js.br +0 -0
- codex/static_root/assets/VCombobox-Bjp6lffE.js.gz +0 -0
- codex/static_root/assets/VDialog-BkpVGB70.6eea3ca762a5.js.br +0 -0
- codex/static_root/assets/VDialog-BkpVGB70.6eea3ca762a5.js.gz +0 -0
- codex/static_root/assets/VDialog-BkpVGB70.js.br +0 -0
- codex/static_root/assets/VDialog-BkpVGB70.js.gz +0 -0
- codex/static_root/assets/VExpansionPanels-Ci2-j8XX.9c55db4ef49e.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-Ci2-j8XX.9c55db4ef49e.js.gz +0 -0
- codex/static_root/assets/VExpansionPanels-Ci2-j8XX.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-Ci2-j8XX.js.gz +0 -0
- codex/static_root/assets/VRadioGroup-D3Py5BfQ.a4f25edb86d3.js.br +0 -0
- codex/static_root/assets/VRadioGroup-D3Py5BfQ.a4f25edb86d3.js.gz +0 -0
- codex/static_root/assets/VRadioGroup-D3Py5BfQ.js.br +0 -0
- codex/static_root/assets/VRadioGroup-D3Py5BfQ.js.gz +0 -0
- codex/static_root/assets/VSelect-DtvZsYZz.e98745d858eb.js.br +0 -0
- codex/static_root/assets/VSelect-DtvZsYZz.e98745d858eb.js.gz +0 -0
- codex/static_root/assets/VSelect-DtvZsYZz.js.br +0 -0
- codex/static_root/assets/VSelect-DtvZsYZz.js.gz +0 -0
- codex/static_root/assets/VSelectionControl-D6kmykQW.1e1fda62ceba.js.br +0 -0
- codex/static_root/assets/VSelectionControl-D6kmykQW.1e1fda62ceba.js.gz +0 -0
- codex/static_root/assets/VSelectionControl-D6kmykQW.js.br +0 -0
- codex/static_root/assets/VSelectionControl-D6kmykQW.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-UGZWxpF5.360bdefcd215.js.br +0 -0
- codex/static_root/assets/VSlideGroup-UGZWxpF5.360bdefcd215.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-UGZWxpF5.js.br +0 -0
- codex/static_root/assets/VSlideGroup-UGZWxpF5.js.gz +0 -0
- codex/static_root/assets/VTable-DXH_yQ0o.1149f56ad566.js.br +0 -0
- codex/static_root/assets/VTable-DXH_yQ0o.1149f56ad566.js.gz +0 -0
- codex/static_root/assets/VTable-DXH_yQ0o.js.br +0 -0
- codex/static_root/assets/VTable-DXH_yQ0o.js.gz +0 -0
- codex/static_root/assets/VTextField-Blqy56_L.26d8761e0155.js.br +0 -0
- codex/static_root/assets/VTextField-Blqy56_L.26d8761e0155.js.gz +0 -0
- codex/static_root/assets/VTextField-Blqy56_L.js.br +0 -0
- codex/static_root/assets/VTextField-Blqy56_L.js.gz +0 -0
- codex/static_root/assets/VWindowItem-C8_ovV7e.afbc08414765.js.br +0 -0
- codex/static_root/assets/VWindowItem-C8_ovV7e.afbc08414765.js.gz +0 -0
- codex/static_root/assets/VWindowItem-C8_ovV7e.js.br +0 -0
- codex/static_root/assets/VWindowItem-C8_ovV7e.js.gz +0 -0
- codex/static_root/assets/admin-DTRn8bBs.d031ea42d8d0.js.br +0 -0
- codex/static_root/assets/admin-DTRn8bBs.d031ea42d8d0.js.gz +0 -0
- codex/static_root/assets/admin-DTRn8bBs.js.br +0 -0
- codex/static_root/assets/admin-DTRn8bBs.js.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-BaXFOcru.b1a44b05f482.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-BaXFOcru.b1a44b05f482.js.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-BaXFOcru.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-BaXFOcru.js.gz +0 -0
- codex/static_root/assets/browser-BBpUyGmz.c1cb9e2d463b.js +0 -1
- codex/static_root/assets/browser-BBpUyGmz.c1cb9e2d463b.js.br +0 -0
- codex/static_root/assets/browser-BBpUyGmz.c1cb9e2d463b.js.gz +0 -0
- codex/static_root/assets/browser-BBpUyGmz.js +0 -1
- codex/static_root/assets/browser-BBpUyGmz.js.br +0 -0
- codex/static_root/assets/browser-BBpUyGmz.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/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-DlHoLhDF.76ab4a29bb9b.js +0 -1
- codex/static_root/assets/change-password-dialog-DlHoLhDF.76ab4a29bb9b.js.br +0 -0
- codex/static_root/assets/change-password-dialog-DlHoLhDF.76ab4a29bb9b.js.gz +0 -0
- codex/static_root/assets/change-password-dialog-DlHoLhDF.js +0 -1
- codex/static_root/assets/change-password-dialog-DlHoLhDF.js.br +0 -0
- codex/static_root/assets/change-password-dialog-DlHoLhDF.js.gz +0 -0
- codex/static_root/assets/confirm-dialog-D3_s2DQy.9dde66036c72.js.br +0 -0
- codex/static_root/assets/confirm-dialog-D3_s2DQy.9dde66036c72.js.gz +0 -0
- codex/static_root/assets/confirm-dialog-D3_s2DQy.js.br +0 -0
- codex/static_root/assets/confirm-dialog-D3_s2DQy.js.gz +0 -0
- codex/static_root/assets/datetime-column-BxC1Li9e.3dc314b3295d.js.br +0 -0
- codex/static_root/assets/datetime-column-BxC1Li9e.3dc314b3295d.js.gz +0 -0
- codex/static_root/assets/datetime-column-BxC1Li9e.js.br +0 -0
- codex/static_root/assets/datetime-column-BxC1Li9e.js.gz +0 -0
- codex/static_root/assets/filter-Bzk7x841.d0c3b602e62d.js.br +0 -0
- codex/static_root/assets/filter-Bzk7x841.d0c3b602e62d.js.gz +0 -0
- codex/static_root/assets/filter-Bzk7x841.js.br +0 -0
- codex/static_root/assets/filter-Bzk7x841.js.gz +0 -0
- codex/static_root/assets/flag-tab-C2bI5zq3.8f8c297600a6.js +0 -1
- codex/static_root/assets/flag-tab-C2bI5zq3.8f8c297600a6.js.br +0 -0
- codex/static_root/assets/flag-tab-C2bI5zq3.8f8c297600a6.js.gz +0 -0
- codex/static_root/assets/flag-tab-C2bI5zq3.js +0 -1
- codex/static_root/assets/flag-tab-C2bI5zq3.js.br +0 -0
- codex/static_root/assets/flag-tab-C2bI5zq3.js.gz +0 -0
- codex/static_root/assets/group-tab-5esH4lwX.a81fdd258117.js.br +0 -0
- codex/static_root/assets/group-tab-5esH4lwX.a81fdd258117.js.gz +0 -0
- codex/static_root/assets/group-tab-5esH4lwX.js.br +0 -0
- codex/static_root/assets/group-tab-5esH4lwX.js.gz +0 -0
- codex/static_root/assets/http-error-BTOBfcGY.52ced6f28420.js.br +0 -0
- codex/static_root/assets/http-error-BTOBfcGY.52ced6f28420.js.gz +0 -0
- codex/static_root/assets/http-error-BTOBfcGY.js.br +0 -0
- codex/static_root/assets/http-error-BTOBfcGY.js.gz +0 -0
- codex/static_root/assets/library-tab-DiPEdOF7.ece2d642a9dc.js.br +0 -0
- codex/static_root/assets/library-tab-DiPEdOF7.ece2d642a9dc.js.gz +0 -0
- codex/static_root/assets/library-tab-DiPEdOF7.js.br +0 -0
- codex/static_root/assets/library-tab-DiPEdOF7.js.gz +0 -0
- codex/static_root/assets/main-BPIPjzsc.66def8991e38.js +0 -6
- codex/static_root/assets/main-BPIPjzsc.66def8991e38.js.br +0 -0
- codex/static_root/assets/main-BPIPjzsc.66def8991e38.js.gz +0 -0
- codex/static_root/assets/main-BPIPjzsc.js +0 -6
- codex/static_root/assets/main-BPIPjzsc.js.br +0 -0
- codex/static_root/assets/main-BPIPjzsc.js.gz +0 -0
- codex/static_root/assets/pager-full-pdf-CiyC6Al9.278b9978f36f.js +0 -1
- codex/static_root/assets/pager-full-pdf-CiyC6Al9.278b9978f36f.js.br +0 -0
- codex/static_root/assets/pager-full-pdf-CiyC6Al9.278b9978f36f.js.gz +0 -0
- codex/static_root/assets/pager-full-pdf-CiyC6Al9.js +0 -1
- codex/static_root/assets/pager-full-pdf-CiyC6Al9.js.br +0 -0
- codex/static_root/assets/pager-full-pdf-CiyC6Al9.js.gz +0 -0
- codex/static_root/assets/pagination-toolbar-C45-onwe.4722195bb60b.css.br +0 -0
- codex/static_root/assets/pagination-toolbar-C45-onwe.4722195bb60b.css.gz +0 -0
- codex/static_root/assets/pagination-toolbar-C45-onwe.css.br +0 -0
- codex/static_root/assets/pagination-toolbar-C45-onwe.css.gz +0 -0
- codex/static_root/assets/pagination-toolbar-CkIzuyx1.00c354a82e6e.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-CkIzuyx1.00c354a82e6e.js.gz +0 -0
- codex/static_root/assets/pagination-toolbar-CkIzuyx1.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-CkIzuyx1.js.gz +0 -0
- codex/static_root/assets/pdf-doc-BjlRPuf4.0f056fa321b6.js.br +0 -0
- codex/static_root/assets/pdf-doc-BjlRPuf4.0f056fa321b6.js.gz +0 -0
- codex/static_root/assets/pdf-doc-BjlRPuf4.js.br +0 -0
- codex/static_root/assets/pdf-doc-BjlRPuf4.js.gz +0 -0
- codex/static_root/assets/reader-_stAWL-4.5089e9144795.css +0 -1
- codex/static_root/assets/reader-_stAWL-4.5089e9144795.css.br +0 -0
- codex/static_root/assets/reader-_stAWL-4.5089e9144795.css.gz +0 -0
- codex/static_root/assets/reader-_stAWL-4.css +0 -1
- codex/static_root/assets/reader-_stAWL-4.css.br +0 -0
- codex/static_root/assets/reader-_stAWL-4.css.gz +0 -0
- codex/static_root/assets/reader-ucxnLi2K.d0fbce0f03c1.js +0 -2
- codex/static_root/assets/reader-ucxnLi2K.d0fbce0f03c1.js.br +0 -0
- codex/static_root/assets/reader-ucxnLi2K.d0fbce0f03c1.js.gz +0 -0
- codex/static_root/assets/reader-ucxnLi2K.js +0 -2
- codex/static_root/assets/reader-ucxnLi2K.js.br +0 -0
- codex/static_root/assets/reader-ucxnLi2K.js.gz +0 -0
- codex/static_root/assets/relation-chips-CUSatZET.a58031ff8141.js.br +0 -0
- codex/static_root/assets/relation-chips-CUSatZET.a58031ff8141.js.gz +0 -0
- codex/static_root/assets/relation-chips-CUSatZET.js.br +0 -0
- codex/static_root/assets/relation-chips-CUSatZET.js.gz +0 -0
- codex/static_root/assets/settings-drawer-BSHTAsJ9.1d07ce084fc9.js.br +0 -0
- codex/static_root/assets/settings-drawer-BSHTAsJ9.1d07ce084fc9.js.gz +0 -0
- codex/static_root/assets/settings-drawer-BSHTAsJ9.js.br +0 -0
- codex/static_root/assets/settings-drawer-BSHTAsJ9.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-DKXVB2Cc.0a3de58bf5ee.js +0 -1
- codex/static_root/assets/stats-tab-DKXVB2Cc.0a3de58bf5ee.js.br +0 -0
- codex/static_root/assets/stats-tab-DKXVB2Cc.0a3de58bf5ee.js.gz +0 -0
- codex/static_root/assets/stats-tab-DKXVB2Cc.js +0 -1
- codex/static_root/assets/stats-tab-DKXVB2Cc.js.br +0 -0
- codex/static_root/assets/stats-tab-DKXVB2Cc.js.gz +0 -0
- codex/static_root/assets/task-tab-NORFAa9p.97e07e366ddd.js.br +0 -0
- codex/static_root/assets/task-tab-NORFAa9p.97e07e366ddd.js.gz +0 -0
- codex/static_root/assets/task-tab-NORFAa9p.js.br +0 -0
- codex/static_root/assets/task-tab-NORFAa9p.js.gz +0 -0
- codex/static_root/assets/unauthorized-RHaQZRfr.a234e9403f60.js +0 -1
- codex/static_root/assets/unauthorized-RHaQZRfr.a234e9403f60.js.br +0 -0
- codex/static_root/assets/unauthorized-RHaQZRfr.a234e9403f60.js.gz +0 -0
- codex/static_root/assets/unauthorized-RHaQZRfr.js +0 -1
- codex/static_root/assets/unauthorized-RHaQZRfr.js.br +0 -0
- codex/static_root/assets/unauthorized-RHaQZRfr.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-CHbyN1EW.e7206db08680.js.br +0 -0
- codex/static_root/assets/user-tab-CHbyN1EW.e7206db08680.js.gz +0 -0
- codex/static_root/assets/user-tab-CHbyN1EW.js.br +0 -0
- codex/static_root/assets/user-tab-CHbyN1EW.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/manifest.0fe31a6cb99f.json +0 -635
- codex/static_root/manifest.0fe31a6cb99f.json.br +0 -0
- codex/static_root/manifest.0fe31a6cb99f.json.gz +0 -0
- codex/templates/search/indexes/codex/comic_text.txt +0 -47
- codex/views/browser/filters/search.py +0 -196
- {codex-1.6.19.dist-info → codex-1.7.0a0.dist-info}/LICENSE +0 -0
- {codex-1.6.19.dist-info → codex-1.7.0a0.dist-info}/WHEEL +0 -0
- {codex-1.6.19.dist-info → codex-1.7.0a0.dist-info}/entry_points.txt +0 -0
|
@@ -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,38 @@
|
|
|
1
|
+
"""Search Filters Methods."""
|
|
2
|
+
|
|
3
|
+
from django.db.models.query import Q
|
|
4
|
+
|
|
5
|
+
from codex.logger.logging import get_logger
|
|
6
|
+
from codex.models import Comic, StoryArc
|
|
7
|
+
from codex.views.browser.filters.search.field.filter import BrowserFieldQueryFilter
|
|
8
|
+
|
|
9
|
+
LOG = get_logger(__name__)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class BrowserFTSFilter(BrowserFieldQueryFilter):
|
|
13
|
+
"""Search Filters Methods."""
|
|
14
|
+
|
|
15
|
+
@staticmethod
|
|
16
|
+
def _get_fts_filter(model, text):
|
|
17
|
+
"""Get the filter dict."""
|
|
18
|
+
prefix = (
|
|
19
|
+
""
|
|
20
|
+
if model == Comic
|
|
21
|
+
else "storyarcnumber__comic__"
|
|
22
|
+
if model == StoryArc
|
|
23
|
+
else "comic__"
|
|
24
|
+
)
|
|
25
|
+
# Custom Lookup defined in codex.models
|
|
26
|
+
rel = prefix + "comicfts__match"
|
|
27
|
+
return {rel: text}
|
|
28
|
+
|
|
29
|
+
def get_fts_filter(self, model, text):
|
|
30
|
+
"""Perform the search and return the scores as a dict."""
|
|
31
|
+
fts_filter = {}
|
|
32
|
+
try:
|
|
33
|
+
if text:
|
|
34
|
+
fts_filter = self._get_fts_filter(model, text)
|
|
35
|
+
except Exception:
|
|
36
|
+
LOG.exception("Getting Full Text Search Filter.")
|
|
37
|
+
self.search_error = "Error creating full text search filter"
|
|
38
|
+
return Q(**fts_filter)
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
"""Search Filters Methods."""
|
|
2
|
+
|
|
3
|
+
import re
|
|
4
|
+
|
|
5
|
+
from codex.logger.logging import get_logger
|
|
6
|
+
from codex.models.comic import ComicFTS
|
|
7
|
+
from codex.views.browser.filters.search.aliases import ALIAS_FIELD_MAP
|
|
8
|
+
from codex.views.browser.filters.search.fts import BrowserFTSFilter
|
|
9
|
+
from codex.views.const import MAX_OBJ_PER_PAGE
|
|
10
|
+
|
|
11
|
+
LOG = get_logger(__name__)
|
|
12
|
+
_FTS_COLUMNS = frozenset(
|
|
13
|
+
{field.name for field in ComicFTS._meta.get_fields()}
|
|
14
|
+
- {"comic", "updated_at", "created_at"}
|
|
15
|
+
)
|
|
16
|
+
_NON_FTS_COLUMNS = frozenset(
|
|
17
|
+
{
|
|
18
|
+
"volume",
|
|
19
|
+
"created_at",
|
|
20
|
+
"updated_at",
|
|
21
|
+
"issue_number",
|
|
22
|
+
"issue_suffix",
|
|
23
|
+
"year",
|
|
24
|
+
"month",
|
|
25
|
+
"day",
|
|
26
|
+
"community_rating",
|
|
27
|
+
"criticial_rating",
|
|
28
|
+
"page_count",
|
|
29
|
+
"monochrome",
|
|
30
|
+
"date",
|
|
31
|
+
"decade",
|
|
32
|
+
"size",
|
|
33
|
+
"path",
|
|
34
|
+
"identifier",
|
|
35
|
+
"identifier_type",
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
_VALID_COLUMNS = frozenset(_FTS_COLUMNS | _NON_FTS_COLUMNS)
|
|
39
|
+
_QUOTES_REXP = r"\".*?\""
|
|
40
|
+
_COLUMN_EXPRESSION_OPERATORS_REXP = (
|
|
41
|
+
rf"(?:{_QUOTES_REXP})|(?P<star>\B[\*\<\>]\w|\.{2,}|\w\*\w)"
|
|
42
|
+
)
|
|
43
|
+
_COLUMN_EXPRESSION_OPERATORS_RE = re.compile(_COLUMN_EXPRESSION_OPERATORS_REXP)
|
|
44
|
+
_FTS_OPERATORS = frozenset({"and", "not", "or", "near"})
|
|
45
|
+
_FTS_OPERATOR_REXP = rf"(?P<operator>\b{'|'.join(_FTS_OPERATORS)}\b)"
|
|
46
|
+
_FTS_OPERATOR_RE = re.compile(_FTS_OPERATOR_REXP, flags=re.IGNORECASE)
|
|
47
|
+
_MULTI_COL_REXP = r"(?P<multi_col>\{.*?\})"
|
|
48
|
+
_SINGLE_COL_REXP = r"(?P<col>[a-z_]+)"
|
|
49
|
+
_EXP_REXP = rf"\s*(?P<exp>\(.*?\)|{_QUOTES_REXP}|\S+)"
|
|
50
|
+
_COL_REXP = rf"({_MULTI_COL_REXP}|{_SINGLE_COL_REXP}):{_EXP_REXP}"
|
|
51
|
+
_TOKEN_PRE_OP_REXP = r"(?:(?P<preop>and|or|not)\s+)?" # noqa: S105
|
|
52
|
+
_TOKEN_REXP = rf"(?P<token>{_TOKEN_PRE_OP_REXP}{_COL_REXP}|\S+)"
|
|
53
|
+
_TOKEN_RE = re.compile(_TOKEN_REXP, flags=re.IGNORECASE)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class SearchFilterView(BrowserFTSFilter):
|
|
57
|
+
"""Search Query Parser."""
|
|
58
|
+
|
|
59
|
+
def __init__(self, *args, **kwargs):
|
|
60
|
+
"""Initialize search variables."""
|
|
61
|
+
super().__init__(*args, **kwargs)
|
|
62
|
+
self.fts_mode = False
|
|
63
|
+
self.search_mode = False
|
|
64
|
+
self.search_error = ""
|
|
65
|
+
|
|
66
|
+
def _is_path_column_allowed(self):
|
|
67
|
+
"""Is path column allowed."""
|
|
68
|
+
if not self.is_admin(): # type: ignore
|
|
69
|
+
if not "folder_view" not in self.admin_flags: # type: ignore
|
|
70
|
+
# Ensure admin flags for Cover View
|
|
71
|
+
self.set_admin_flags() # type: ignore
|
|
72
|
+
return bool(self.admin_flags.get("folder_view")) # type: ignore
|
|
73
|
+
return True
|
|
74
|
+
|
|
75
|
+
@staticmethod
|
|
76
|
+
def _is_column_operators_used(exp):
|
|
77
|
+
"""Detect column expression operators, but not inside quotes."""
|
|
78
|
+
for match in _COLUMN_EXPRESSION_OPERATORS_RE.finditer(exp):
|
|
79
|
+
if match.group("star"):
|
|
80
|
+
return True
|
|
81
|
+
return False
|
|
82
|
+
|
|
83
|
+
def _parse_column_match(self, preop, col, exp, field_tokens): # , fts_tokens):
|
|
84
|
+
col = ALIAS_FIELD_MAP.get(col, col)
|
|
85
|
+
if col not in _VALID_COLUMNS:
|
|
86
|
+
return True
|
|
87
|
+
if col == "path" and not self._is_path_column_allowed():
|
|
88
|
+
return True
|
|
89
|
+
if col in _NON_FTS_COLUMNS or self._is_column_operators_used(exp):
|
|
90
|
+
if not preop:
|
|
91
|
+
preop = "and"
|
|
92
|
+
if preop not in field_tokens:
|
|
93
|
+
field_tokens[preop] = set()
|
|
94
|
+
field_tokens[preop].add((col, exp))
|
|
95
|
+
return True
|
|
96
|
+
|
|
97
|
+
return False
|
|
98
|
+
|
|
99
|
+
@staticmethod
|
|
100
|
+
def _add_fts_token(fts_tokens, token):
|
|
101
|
+
token = _FTS_OPERATOR_RE.sub(lambda op: op.group("operator").upper(), token)
|
|
102
|
+
if (
|
|
103
|
+
token.lower() not in _FTS_OPERATORS
|
|
104
|
+
and not (token.startswith('"') and token.endswith('"'))
|
|
105
|
+
and ":" not in token
|
|
106
|
+
):
|
|
107
|
+
token = f'"{token}"'
|
|
108
|
+
fts_tokens.append(token)
|
|
109
|
+
|
|
110
|
+
def _preparse_search_query_token(self, match, field_tokens, fts_tokens):
|
|
111
|
+
token = match.group("token")
|
|
112
|
+
if not token:
|
|
113
|
+
return
|
|
114
|
+
|
|
115
|
+
multi_col = match.group("multi_col")
|
|
116
|
+
col = match.group("col")
|
|
117
|
+
exp = match.group("exp")
|
|
118
|
+
if multi_col or not col or not exp:
|
|
119
|
+
# I could add multi-col to field groups, but nobody will care.
|
|
120
|
+
self._add_fts_token(fts_tokens, token)
|
|
121
|
+
return
|
|
122
|
+
|
|
123
|
+
preop = match.group("preop")
|
|
124
|
+
if not self._parse_column_match(preop, col, exp, field_tokens):
|
|
125
|
+
self._add_fts_token(fts_tokens, token)
|
|
126
|
+
|
|
127
|
+
def _preparse_search_query(self):
|
|
128
|
+
"""Preparse search fields out of query text."""
|
|
129
|
+
text = self.params.get("q") # type: ignore
|
|
130
|
+
field_tokens = {}
|
|
131
|
+
if not text:
|
|
132
|
+
return field_tokens, text
|
|
133
|
+
|
|
134
|
+
fts_tokens = []
|
|
135
|
+
for match in _TOKEN_RE.finditer(text):
|
|
136
|
+
try:
|
|
137
|
+
self._preparse_search_query_token(match, field_tokens, fts_tokens)
|
|
138
|
+
except Exception as exc:
|
|
139
|
+
tok = match.group(0) if match else "<unmatched>"
|
|
140
|
+
LOG.debug(f"Error preparsing search query token {tok}: {exc}")
|
|
141
|
+
self.search_error = "Syntax error"
|
|
142
|
+
text = " ".join(fts_tokens)
|
|
143
|
+
|
|
144
|
+
return field_tokens, text
|
|
145
|
+
|
|
146
|
+
def _create_search_filters(self, model):
|
|
147
|
+
field_tokens_dict, fts_text = self._preparse_search_query()
|
|
148
|
+
field_filter_q_list = []
|
|
149
|
+
field_exclude_q_list = []
|
|
150
|
+
for preop, field_token_pairs in field_tokens_dict.items():
|
|
151
|
+
if preop == "not":
|
|
152
|
+
exclude_q_list, filter_q_list = self.get_search_field_filters(
|
|
153
|
+
model, field_token_pairs
|
|
154
|
+
)
|
|
155
|
+
else:
|
|
156
|
+
# AND and OR
|
|
157
|
+
# XXX cannot do OR queries with MATCH, it decontextualizes MATCH somehow.
|
|
158
|
+
if preop == "or":
|
|
159
|
+
self.search_error = "OR preceding column tokens with operator expressions will act as AND"
|
|
160
|
+
filter_q_list, exclude_q_list = self.get_search_field_filters(
|
|
161
|
+
model, field_token_pairs
|
|
162
|
+
)
|
|
163
|
+
field_filter_q_list += filter_q_list
|
|
164
|
+
field_exclude_q_list += exclude_q_list
|
|
165
|
+
fts_filter = self.get_fts_filter(model, fts_text)
|
|
166
|
+
return field_exclude_q_list, field_filter_q_list, fts_filter
|
|
167
|
+
|
|
168
|
+
def _apply_search_filter_list(self, qs, filter_list, exclude):
|
|
169
|
+
"""Apply search filter lists. Separate filter clauses are employed for m2m searches."""
|
|
170
|
+
for q in filter_list:
|
|
171
|
+
if not q:
|
|
172
|
+
continue
|
|
173
|
+
qs = qs.exclude(q) if exclude else qs.filter(q)
|
|
174
|
+
self.search_mode = True
|
|
175
|
+
|
|
176
|
+
return qs
|
|
177
|
+
|
|
178
|
+
def apply_search_filter(self, qs, model):
|
|
179
|
+
"""Preparse search, search and return the filter and scores."""
|
|
180
|
+
try:
|
|
181
|
+
field_exclude_q_list, field_filter_q_list, fts_filter = (
|
|
182
|
+
self._create_search_filters(model)
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
# Apply filters
|
|
186
|
+
qs = self._apply_search_filter_list(qs, field_exclude_q_list, True)
|
|
187
|
+
qs = self._apply_search_filter_list(qs, field_filter_q_list, False)
|
|
188
|
+
if fts_filter:
|
|
189
|
+
qs = qs.filter(fts_filter)
|
|
190
|
+
self.search_mode = self.fts_mode = True
|
|
191
|
+
|
|
192
|
+
except Exception as exc:
|
|
193
|
+
msg = "Creating search filters"
|
|
194
|
+
LOG.exception(msg)
|
|
195
|
+
msg = f"{msg} - {exc}"
|
|
196
|
+
self.search_error = msg
|
|
197
|
+
|
|
198
|
+
return qs
|
|
199
|
+
|
|
200
|
+
def _is_search_results_limited(self) -> bool:
|
|
201
|
+
"""Get search result limit from params."""
|
|
202
|
+
# user = self.request.user # type: ignore
|
|
203
|
+
# if user and user.is_authenticated:
|
|
204
|
+
# limited = bool(
|
|
205
|
+
# self.params.get( # type: ignore
|
|
206
|
+
# "search_results_limit",
|
|
207
|
+
# MAX_OBJ_PER_PAGE,
|
|
208
|
+
# )
|
|
209
|
+
# )
|
|
210
|
+
# else:
|
|
211
|
+
# limited = True
|
|
212
|
+
# return limited
|
|
213
|
+
return True
|
|
214
|
+
|
|
215
|
+
def get_search_limit(self):
|
|
216
|
+
"""Get search scores for choices and metadata."""
|
|
217
|
+
if not self.search_mode or not self._is_search_results_limited():
|
|
218
|
+
return 0
|
|
219
|
+
page = self.kwargs.get("page", 1) # type: ignore
|
|
220
|
+
return page * MAX_OBJ_PER_PAGE + 1
|
codex/views/browser/order_by.py
CHANGED
|
@@ -13,8 +13,14 @@ class BrowserOrderByView(BrowserAnnotationsFilterView):
|
|
|
13
13
|
|
|
14
14
|
def set_order_key(self):
|
|
15
15
|
"""Get the default order key for the view."""
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
order_key: str = self.params["order_by"]
|
|
17
|
+
if order_key == "search_score" and not self.fts_mode:
|
|
18
|
+
# if no search scores, use sort_name, asc
|
|
19
|
+
order_key = "sort_name"
|
|
20
|
+
order_reverse = False
|
|
21
|
+
else:
|
|
22
|
+
order_reverse = self.params.get("order_reverse")
|
|
23
|
+
self.order_key = order_key
|
|
18
24
|
self.order_agg_func = Max if order_reverse else Min
|
|
19
25
|
|
|
20
26
|
def _add_comic_order_by(self, order_key, comic_sort_names):
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"""Browser Page Bounds Checking."""
|
|
2
|
+
|
|
3
|
+
from codex.logger.logging import get_logger
|
|
4
|
+
from codex.views.browser.annotations import BrowserAnnotationsView
|
|
5
|
+
from codex.views.util import Route
|
|
6
|
+
|
|
7
|
+
LOG = get_logger(__name__)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class BrowserPageInBoundsView(BrowserAnnotationsView):
|
|
11
|
+
"""Browser Page Bounds Checking."""
|
|
12
|
+
|
|
13
|
+
def _get_back_one_page_route(self, num_pages):
|
|
14
|
+
"""Get max page if oob or 1."""
|
|
15
|
+
LOG.debug("Redirect back one page.")
|
|
16
|
+
group = self.kwargs.get("group")
|
|
17
|
+
pks = self.kwargs.get("pks")
|
|
18
|
+
page = self.kwargs.get("page", 1)
|
|
19
|
+
new_page = num_pages if num_pages and page > num_pages else 1
|
|
20
|
+
pks = pks if pks else "0"
|
|
21
|
+
return {"group": group, "pks": pks, "page": new_page}
|
|
22
|
+
|
|
23
|
+
def _get_up_breadcrumbs(self):
|
|
24
|
+
"""Walk up the breadcrumbs to get the next level up."""
|
|
25
|
+
breadcrumbs = self.params.get("breadcrumbs", [])
|
|
26
|
+
new_breadcrumbs = []
|
|
27
|
+
level = False
|
|
28
|
+
group = self.kwargs.get("group")
|
|
29
|
+
pks = self.kwargs.get("pks")
|
|
30
|
+
page = self.kwargs.get("page", 1)
|
|
31
|
+
current_route = Route(group=group, pks=pks, page=page)
|
|
32
|
+
for crumb in reversed(breadcrumbs):
|
|
33
|
+
if not level:
|
|
34
|
+
crumb_route = Route(**crumb)
|
|
35
|
+
level = current_route & crumb_route
|
|
36
|
+
continue
|
|
37
|
+
new_breadcrumbs = [crumb, *new_breadcrumbs]
|
|
38
|
+
|
|
39
|
+
if not new_breadcrumbs:
|
|
40
|
+
if group not in ("f", "a"):
|
|
41
|
+
group = "r"
|
|
42
|
+
top_route = {"group": group, "pks": (), "page": 1}
|
|
43
|
+
new_breadcrumbs = [top_route]
|
|
44
|
+
return new_breadcrumbs
|
|
45
|
+
|
|
46
|
+
def _get_up_page_redirect(self):
|
|
47
|
+
"""Walk up the breadcrumbs."""
|
|
48
|
+
try:
|
|
49
|
+
up_breadcrumbs = self._get_up_breadcrumbs()
|
|
50
|
+
route_mask = up_breadcrumbs[-1]
|
|
51
|
+
settings_mask = {"breadcrumbs": up_breadcrumbs}
|
|
52
|
+
LOG.debug("Redirect up a level.")
|
|
53
|
+
except IndexError:
|
|
54
|
+
group = self.kwargs.get("group")
|
|
55
|
+
pks = "0"
|
|
56
|
+
new_page = 1
|
|
57
|
+
route_mask = {"group": group, "pks": pks, "page": new_page}
|
|
58
|
+
settings_mask = {"breadcrumbs": [route_mask]}
|
|
59
|
+
LOG.debug("Redirect to all at current group.")
|
|
60
|
+
return route_mask, settings_mask
|
|
61
|
+
|
|
62
|
+
def _handle_page_out_of_bounds(self, num_pages):
|
|
63
|
+
"""Handle out of bounds redirect."""
|
|
64
|
+
# Try to find a logical page to run to.
|
|
65
|
+
group = self.kwargs.get("group")
|
|
66
|
+
page = self.kwargs.get("page", 1)
|
|
67
|
+
pks = self.kwargs.get("pks")
|
|
68
|
+
reason = f"{group=} {pks=} {page=} does not exist."
|
|
69
|
+
|
|
70
|
+
# Adjust route mask for redirect
|
|
71
|
+
if num_pages and page > 1:
|
|
72
|
+
route_mask = self._get_back_one_page_route(num_pages)
|
|
73
|
+
settings_mask = None
|
|
74
|
+
else:
|
|
75
|
+
# This now only occurs when page < 1
|
|
76
|
+
route_mask, settings_mask = self._get_up_page_redirect()
|
|
77
|
+
|
|
78
|
+
self.raise_redirect(reason, route_mask=route_mask, settings_mask=settings_mask)
|
|
79
|
+
|
|
80
|
+
def check_page_in_bounds(self, num_pages: int):
|
|
81
|
+
"""Redirect page out of bounds."""
|
|
82
|
+
page = self.kwargs.get("page", 1)
|
|
83
|
+
if page == 1 or (page >= 1 and page <= num_pages):
|
|
84
|
+
# Don't redirect if on the root page for the group.
|
|
85
|
+
# Or page within valid range.
|
|
86
|
+
return
|
|
87
|
+
|
|
88
|
+
self._handle_page_out_of_bounds(num_pages)
|