accrete 0.0.36__py3-none-any.whl → 0.0.37__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.
@@ -0,0 +1,14 @@
1
+ from django.db.models import Model
2
+
3
+
4
+ def get_related_model(model: type[Model], rel_path: str):
5
+ related_model = model
6
+ for part in rel_path.split('__'):
7
+ try:
8
+ related_model = related_model._meta.fields_map[part].related_model
9
+ except (AttributeError, KeyError):
10
+ try:
11
+ related_model = getattr(related_model, part).field.related_model
12
+ except AttributeError:
13
+ break
14
+ return related_model
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: accrete
3
- Version: 0.0.36
3
+ Version: 0.0.37
4
4
  Summary: Django Shared Schema Multi Tenant
5
5
  Author-email: Benedikt Jilek <benedikt.jilek@pm.me>
6
6
  License: Copyright (c) 2023 Benedikt Jilek
@@ -1,12 +1,13 @@
1
1
  accrete/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  accrete/admin.py,sha256=MUYUmCFlGYPowiXTbwl4_Q6Cq0-neiL53WW4P76JCLs,1174
3
+ accrete/annotation.py,sha256=-nYqDQPOixkD9qdzVZDCIA4lETH2fAZcCSxNmaY2s80,1251
3
4
  accrete/apps.py,sha256=F7ynMLHJr_6bRujWtZVUzCliY2CGKiDvyUmL4F68L2E,146
4
5
  accrete/config.py,sha256=eJUbvyBO3DvAD6xkVKjTAzlXy7V7EK9bVyb91girfUs,299
5
6
  accrete/forms.py,sha256=nPDgSZao-vuVFRam2Py18yiet3Bar-A-qkWjwbeUDlg,11235
6
- accrete/middleware.py,sha256=ldnMI4Wv9p1JUyFX_sQSa6Hg4MgkXNbKaHqq5aRsD8s,2629
7
- accrete/models.py,sha256=OcxHnmFWity-Pfgj-jOhrxzZ44MdqmLxTH-xwrbtz7w,5974
7
+ accrete/middleware.py,sha256=RWeHHcYCfpVO4EnG5HMS52F1y5OKRzNCuidMeq6b0zY,3176
8
+ accrete/models.py,sha256=ruPKqNeKYzqSpYRhpQ12S82iJDYxy0EjSEtNSKWeRz4,6126
8
9
  accrete/queries.py,sha256=bchiqLzE1DmR9kvQ6Yyog6cNlYK_lxpztQMOx6Hy_0c,410
9
- accrete/querystring.py,sha256=QxSrmntM20QApzhzSgA0-zDRvWzuNYYW6uNey15mjKY,3395
10
+ accrete/querystring.py,sha256=TEJ-PhNj1xfA5a2gL6QwD3r33CIcUpLjr5ju0RIgd_I,3140
10
11
  accrete/tenant.py,sha256=g3ZuTrQr2zqmIopNBRQeCmHEK2R3dlUme_hOV765J6U,1778
11
12
  accrete/tests.py,sha256=Agltbzwwh5htvq_Qi9vqvxutzmg_GwgPS_N19xJZRlw,7197
12
13
  accrete/views.py,sha256=9-sgCFe_CyG-wllAcIOLujyueiq66C-zg0U7Uf5Y2wU,2954
@@ -32,13 +33,12 @@ accrete/contrib/system_mail/tests.py,sha256=mrbGGRNg5jwbTJtWWa7zSKdDyeB4vmgZCRc2
32
33
  accrete/contrib/system_mail/views.py,sha256=xc1IQHrsij7j33TUbo-_oewy3vs03pw_etpBWaMYJl0,63
33
34
  accrete/contrib/system_mail/migrations/0001_initial.py,sha256=6cwkkRXGjXvwXoMjjgmWmcPyXSTlUbhW1vMiHObk9MQ,1074
34
35
  accrete/contrib/system_mail/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
- accrete/contrib/ui/__init__.py,sha256=Jw0rophuHm7UoImNU8rroHCofMpsEAEce7cjzp6lqX4,576
36
+ accrete/contrib/ui/__init__.py,sha256=D_QP3FW_4IzP2c_4WTWyuRIENDA1AFrSOXWL_FNeSMY,445
36
37
  accrete/contrib/ui/admin.py,sha256=suMo4x8I3JBxAFBVIdE-5qnqZ6JAZV0FESABHOSc-vg,63
37
38
  accrete/contrib/ui/apps.py,sha256=E0ao2ox6PQ3ldfeR17FXJUUJuGiWjm2DPCxHbPXGzls,152
38
- accrete/contrib/ui/context.py,sha256=sFYKjuDA86lReTzV1ylZu0UWDXuWJUUnqg68swDM4gM,10106
39
+ accrete/contrib/ui/context.py,sha256=lBX3Ga-54cRDnbmFT28afCypbtwg65qNtjKbiQz2jmI,6242
39
40
  accrete/contrib/ui/elements.py,sha256=g6wksl7hHGJb3CKmkio5rWgcpr1Eyr2vxbKVD-59lkc,1570
40
- accrete/contrib/ui/filter.py,sha256=WrbZHk9PZsh-Gbyqm52bt9Kr0zinecRLTAXt3rfVOFQ,10789
41
- accrete/contrib/ui/querystring.py,sha256=vMP_4Hn6L3jCLf6_HIscZkPgkZGe9g9Y7GfI2zZYn2A,709
41
+ accrete/contrib/ui/filter.py,sha256=39Kms9jS-ruuursyUbnazrM3DrBsMSEr81Lh6EelUqs,13047
42
42
  accrete/contrib/ui/tests.py,sha256=mrbGGRNg5jwbTJtWWa7zSKdDyeB4vmgZCRc2nk6VY-g,60
43
43
  accrete/contrib/ui/urls.py,sha256=TUBlz_CGs9InTZoxM78GSnucA73I8knoh_obt12RUHM,186
44
44
  accrete/contrib/ui/views.py,sha256=WpBKMsxFFG8eG4IN7TW_TPE6i3OFF7gnLDTK7JMKti8,191
@@ -117,14 +117,15 @@ accrete/contrib/ui/static/bulma/sass/utilities/extends.sass,sha256=jb5Ipy_k6hBSF
117
117
  accrete/contrib/ui/static/bulma/sass/utilities/functions.sass,sha256=tRNFJ9yQTS-GZ6ouJ7EIWiFITL7irYR7srzKwzacvUA,4896
118
118
  accrete/contrib/ui/static/bulma/sass/utilities/initial-variables.sass,sha256=JXNQHoF4YlBTUW6WSJ14_38SA9lbk6VkouzYURmlV8g,2691
119
119
  accrete/contrib/ui/static/bulma/sass/utilities/mixins.sass,sha256=oijSh2f1DPqod0W5op9iVEAFbC1huMqBIJmnHRx3exc,6291
120
- accrete/contrib/ui/static/css/accrete.css,sha256=seWy0cX31YB6IE26iqjLteZXxBpvQpo92EjLTnLRtCc,253314
120
+ accrete/contrib/ui/static/css/accrete.css,sha256=XflTQHcjaGSFHjtojR1t8MWSt2MRDEQPeWH5QuU1hIo,253378
121
121
  accrete/contrib/ui/static/css/accrete.css.bak,sha256=2RErGa8_tm8lFSamfW3UfqPgEVkPDejk2fh8IidW-B0,2359
122
- accrete/contrib/ui/static/css/accrete.css.map,sha256=ZiVnkZ0jHY-ehK-WSoboneSeKdYiY6x-Ge2aCLkEObs,55936
123
- accrete/contrib/ui/static/css/accrete.scss,sha256=dSW0qis_-2xPfbhx_6cghn5Fni0o-EX4pSdE-BLwnRg,5694
122
+ accrete/contrib/ui/static/css/accrete.css.map,sha256=eAGk5OIGglWaUl-B8ORQI24KwqZfYj_tkkTfEFr9MwU,55936
123
+ accrete/contrib/ui/static/css/accrete.scss,sha256=KCY4QZNNVtIvogyNYkSwxeFzCCHs1MD4-l-f5bL6QFM,5694
124
124
  accrete/contrib/ui/static/css/icons.css,sha256=IMdNurvI1cUwpGG8n3UXRkxl8MqP2Eqkvyh2maeyghw,6301
125
125
  accrete/contrib/ui/static/icons/Logo.svg,sha256=hGZuxrAa-LRpFavFiF8Lnc7X9OQcqmb6Xl_dxx-27hM,1861
126
126
  accrete/contrib/ui/static/icons/accrete.svg,sha256=CWHJKIgk3hxL7xIaFSz2j1cK-eF1TroCbjcF58bgOIs,1024
127
- accrete/contrib/ui/static/js/filter.js,sha256=_FJGcSX764ju0zZOpmXb3pcYQMFoi8sOEmvHCyMqeJY,22089
127
+ accrete/contrib/ui/static/js/filter.js,sha256=wMK4rIx4J8ps3uB6J1z2wRAZ5MzkAN6D8EhFQiXybjM,22864
128
+ accrete/contrib/ui/static/js/htmx.min.js,sha256=s73PXHQYl6U2SLEgf_8EaaDWGQFCm6H26I-Y69hOZp4,47755
128
129
  accrete/contrib/ui/static/js/list.js,sha256=OX_81ifRmawE-1QBU5Qpq_E6sHiiNwIPleETAn9EOJw,4280
129
130
  accrete/contrib/ui/templates/django/forms/widgets/attrs.html,sha256=zNxjU4Ta_eWZkh1WhrF_VIwNZ0lZyl980gSSijUK51k,195
130
131
  accrete/contrib/ui/templates/django/forms/widgets/email.html,sha256=fXpbxMzAdbv_avfWC5464gD2jFng931Eq7vzbzy1-yA,48
@@ -135,13 +136,13 @@ accrete/contrib/ui/templates/django/forms/widgets/text.html,sha256=MSmLlQc7PsPoD
135
136
  accrete/contrib/ui/templates/django/forms/widgets/textarea.html,sha256=c9BTedqb3IkXLyVYd0p9pR8DFnsXCNGoxVBWZTk_Fic,278
136
137
  accrete/contrib/ui/templates/ui/detail.html,sha256=0sqsW_XbtLVIquXA8157ZWamnwRc4Wp-6_aZgZ5HN64,1051
137
138
  accrete/contrib/ui/templates/ui/form.html,sha256=kIIG4zzNbxb5fJAVr3lI05oa3yoxyAwstMeQWLa2Z0Y,409
138
- accrete/contrib/ui/templates/ui/layout.html,sha256=zcu61dzpW-eFQrRDQ5whXAdTrUHw3OzhF8-q2a_bEHY,8663
139
- accrete/contrib/ui/templates/ui/list.html,sha256=QKq6XfTNnG1oqvuhCkPARghaDCMSCwGx-L-qFp94pwA,1254
140
- accrete/contrib/ui/templates/ui/table.html,sha256=9YEEu0pbgMT5BGrrusruPf4mYYdTLSrPyx1GuT0XPGw,3860
141
- accrete/contrib/ui/templates/ui/partials/filter.html,sha256=ZabSudRBRBL_dr-EKg1ikYOQe8chzZIvQzErBGxzfzk,2721
139
+ accrete/contrib/ui/templates/ui/layout.html,sha256=qxLTBR16uh3ed1qm_eC-GrFkN6RYZZx0k1bX07Dcfz4,9247
140
+ accrete/contrib/ui/templates/ui/list.html,sha256=dcPS1aSN9GlsljJsTNhKMqgPe8goF1uwknZ4DIbElLU,1212
141
+ accrete/contrib/ui/templates/ui/table.html,sha256=xVSFKrjO_2YkSEO3nspHqMj8mQU4ZV8GSAQFSsAk5SI,3868
142
+ accrete/contrib/ui/templates/ui/partials/filter.html,sha256=Y2-9fwV_sjrsu-Jvuh8hseku0mQTjsnePSHemps3Tqg,3936
142
143
  accrete/contrib/ui/templates/ui/partials/form_errors.html,sha256=1_TQvTdiejsn-43YSyp2YfnP52P-MFYb-HGY0DLm4oA,991
143
144
  accrete/contrib/ui/templates/ui/partials/form_modal.html,sha256=FFDfI5qjOCUBSGqDjBXa8tcqN2q94wOOCNFDaiyplHQ,1032
144
- accrete/contrib/ui/templates/ui/partials/header.html,sha256=UHL9gJwEr7pOgivIMcbLgzAB3YzxVmjhH3GdfQDcB_Q,2838
145
+ accrete/contrib/ui/templates/ui/partials/header.html,sha256=Fr65wv84RgcjpRr1jRdGzChaX08SVhmFhcdEmkTBmyI,2859
145
146
  accrete/contrib/ui/templates/ui/partials/onchange_form.html,sha256=K5twTGqRUW1iM2dGtdWntjsJvJVo5EIzKxX2HK-H1yw,160
146
147
  accrete/contrib/ui/templates/ui/partials/pagination_detail.html,sha256=58nA3X7Il0FAD4VcYyr7tTGWRiVf_FN1TkImmKEpKHU,1014
147
148
  accrete/contrib/ui/templates/ui/partials/pagination_list.html,sha256=9h-I5PfjViomZjoeBUZIwmx7tgWodCs4bDtjOdsPQ8c,1379
@@ -150,7 +151,7 @@ accrete/contrib/ui/templates/ui/partials/table_field_float.html,sha256=GH_jFdpk8
150
151
  accrete/contrib/ui/templates/ui/partials/table_field_monetary.html,sha256=Wtod9vel2dD4vG8lUVLbtls4aU_2EG3p0E1QRRUSH10,166
151
152
  accrete/contrib/ui/templates/ui/partials/table_field_string.html,sha256=GH_jFdpk8wEJXv4QfO6c3URYrZGGLeuSyWwWl2cWxwQ,45
152
153
  accrete/contrib/ui/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
153
- accrete/contrib/ui/templatetags/accrete_ui.py,sha256=8Ryvwg8_DWYzCehZJTeiq66AvWLbcRTrAe5oxTk8Vzc,1320
154
+ accrete/contrib/ui/templatetags/accrete_ui.py,sha256=ttu2dN5xVMOaON1gyd6Dk22TGt3RQQr97YECrwVgDmw,1593
154
155
  accrete/contrib/user/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
155
156
  accrete/contrib/user/admin.py,sha256=YS4iApli7XUaIl9GsEJxys2j8sepX0by88omYHjff-E,85
156
157
  accrete/contrib/user/apps.py,sha256=oHDrAiHf-G57mZLyxqGJzRY2DbPprGFD-QgyVJG_ruI,156
@@ -159,7 +160,7 @@ accrete/contrib/user/middleware.py,sha256=qblcujwJsthopagyT-hPFq4HsMyGt-VvqZw5TQ
159
160
  accrete/contrib/user/models.py,sha256=SFEXG9G-XY7Nuss7DT51abDv8BWLHKYJocOhQDI_1Lw,3926
160
161
  accrete/contrib/user/tests.py,sha256=mrbGGRNg5jwbTJtWWa7zSKdDyeB4vmgZCRc2nk6VY-g,60
161
162
  accrete/contrib/user/urls.py,sha256=ktQJ3vZxDlKNUfzOxReeDLOduSdoW5z5Sz0LVFpxZGU,460
162
- accrete/contrib/user/views.py,sha256=u5fNXCLh_JAB86rpTu0kWG1twRDLRsphB0VvxP2rRZI,3744
163
+ accrete/contrib/user/views.py,sha256=82-RPqabxE6o7cglnfZmCUxNNRii4pmVFGiTThE4Zp0,3727
163
164
  accrete/contrib/user/locale/de/LC_MESSAGES/django.mo,sha256=p3rgUg6WltAVIMkQsjvjBqTsd_usLhSr1GH4Cyltc2c,433
164
165
  accrete/contrib/user/locale/de/LC_MESSAGES/django.po,sha256=f_Nxpo3HTm2L3f3zoHLfeWsZ-4IQp_EEVSku6TCZSvw,1870
165
166
  accrete/contrib/user/migrations/0001_initial.py,sha256=JWfM9PcMDfkJUdCjLWuWieGs6643qP0KdbCyr5uAZoY,2950
@@ -167,7 +168,7 @@ accrete/contrib/user/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm
167
168
  accrete/contrib/user/templates/user/accrete_navbar_end_dropdown.html,sha256=vDFjrOZ95doOpdGYSCRlP8H-FfKUWpkYgYP8mOKcboY,481
168
169
  accrete/contrib/user/templates/user/change_email.html,sha256=i9ZgDH31awO9W87E6c3_MKgQNf1ff7EYQX1nEdPqRC8,995
169
170
  accrete/contrib/user/templates/user/change_password.html,sha256=wcwm5_tfPgs9V7VWdDQqhhyMpcIkiGsx2OIptF5fWMk,1498
170
- accrete/contrib/user/templates/user/login.html,sha256=qKUqF5WCkWPrbwQMaa05Ou7zkM_CeVrJzHsjsDWNPhQ,1644
171
+ accrete/contrib/user/templates/user/login.html,sha256=TuEH4uKK1CFV5X7nP3xPSzu2VJaoEn6APsHh-k6GiCc,1388
171
172
  accrete/contrib/user/templates/user/user_detail.html,sha256=SMkghUKVncVq3KFGBxADJf_wDnLYwmK4oDTKLO0Ejlo,1445
172
173
  accrete/contrib/user/templates/user/user_form.html,sha256=4o24KV940D_KsBP4YwBguwTFW9nYz1uz-RILs91M7Po,1935
173
174
  accrete/contrib/user_registration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -188,7 +189,8 @@ accrete/migrations/0002_initial.py,sha256=dFOM7kdHlx7pVAh8cTDlZMtciN4O9Z547HAzEK
188
189
  accrete/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
189
190
  accrete/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
190
191
  accrete/utils/dates.py,sha256=apM6kt6JhGrKgoT0jfav1W-8AUVTxNc9xt3fJQ2n0JI,1492
191
- accrete-0.0.36.dist-info/METADATA,sha256=EjnI0LPcO3n-3j_-yapP4vREwv2tVV5ryG0u_BjB6Ww,4892
192
- accrete-0.0.36.dist-info/WHEEL,sha256=TJPnKdtrSue7xZ_AVGkp9YXcvDrobsjBds1du3Nx6dc,87
193
- accrete-0.0.36.dist-info/licenses/LICENSE,sha256=_7laeMIHnsd3Y2vJEXDYXq_PEXxIcjgJsGt8UIKTRWc,1057
194
- accrete-0.0.36.dist-info/RECORD,,
192
+ accrete/utils/models.py,sha256=qAdWovkztpvFZHY7VzK4hGIMUjBcA9iQtqYFgz7z2ro,474
193
+ accrete-0.0.37.dist-info/METADATA,sha256=DKhGve3m6OHxG8gFRrsGmdShLC6Ttph3HlvB6_5ACQU,4892
194
+ accrete-0.0.37.dist-info/WHEEL,sha256=TJPnKdtrSue7xZ_AVGkp9YXcvDrobsjBds1du3Nx6dc,87
195
+ accrete-0.0.37.dist-info/licenses/LICENSE,sha256=_7laeMIHnsd3Y2vJEXDYXq_PEXxIcjgJsGt8UIKTRWc,1057
196
+ accrete-0.0.37.dist-info/RECORD,,
@@ -1,19 +0,0 @@
1
- import json
2
-
3
-
4
- def load_querystring(get_params: dict) -> list:
5
- return json.loads(get_params.get('q', '[]'))
6
-
7
-
8
- def build_querystring(get_params: dict, extra_params: list[str] = None) -> str:
9
- querystring = f'?q={get_params.get("q", "[]")}'
10
- if paginate_by := get_params.get('paginate_by', False):
11
- querystring += f'&paginate_by={paginate_by}'
12
- if order_by := get_params.get('order_by', False):
13
- querystring += f'&order_by={order_by}'
14
- if crumbs := get_params.get('crumbs', False):
15
- querystring += f'&crumbs={crumbs}'
16
- for param in extra_params or []:
17
- if value := get_params.get(param, False):
18
- querystring += f'&{param}={value}'
19
- return querystring