accrete 0.0.96__py3-none-any.whl → 0.0.97__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.
- accrete/contrib/ui/templates/ui/partials/filter.html +32 -28
- accrete/managers.py +8 -3
- accrete/utils/log.py +16 -0
- {accrete-0.0.96.dist-info → accrete-0.0.97.dist-info}/METADATA +1 -1
- {accrete-0.0.96.dist-info → accrete-0.0.97.dist-info}/RECORD +7 -6
- {accrete-0.0.96.dist-info → accrete-0.0.97.dist-info}/WHEEL +0 -0
- {accrete-0.0.96.dist-info → accrete-0.0.97.dist-info}/licenses/LICENSE +0 -0
@@ -71,17 +71,19 @@
|
|
71
71
|
</button>
|
72
72
|
</div>
|
73
73
|
{% endif %}
|
74
|
-
|
75
|
-
<
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
<
|
82
|
-
|
83
|
-
|
84
|
-
|
74
|
+
{% if order_selection %}
|
75
|
+
<div class="control is-expanded">
|
76
|
+
<button id="list-customization-order-trigger"
|
77
|
+
class="button dropdown-button side-panel-action-content is-fullwidth"
|
78
|
+
onclick="setDropDown(this)" data-dropdown-id="list-customization-order"
|
79
|
+
>
|
80
|
+
<span>{% translate 'Order' %}</span>
|
81
|
+
<span class="icon is-small">
|
82
|
+
<i class="fa fa-angle-down"></i>
|
83
|
+
</span>
|
84
|
+
</button>
|
85
|
+
</div>
|
86
|
+
{% endif %}
|
85
87
|
</div>
|
86
88
|
</div>
|
87
89
|
|
@@ -114,26 +116,28 @@
|
|
114
116
|
</div>
|
115
117
|
{% endif %}
|
116
118
|
|
117
|
-
|
118
|
-
<div class="dropdown-
|
119
|
-
<div class="dropdown-
|
120
|
-
<div class="dropdown-
|
121
|
-
<div class="
|
122
|
-
<
|
123
|
-
<
|
124
|
-
|
125
|
-
|
126
|
-
<
|
127
|
-
<
|
128
|
-
|
129
|
-
|
119
|
+
{% if order_selection %}
|
120
|
+
<div id="list-customization-order" class="dropdown is-flex-grow-1 pt-0" role="menu" data-dropdown-trigger-id="list-customization-order-trigger">
|
121
|
+
<div class="dropdown-menu pt-0" style="width: 100%">
|
122
|
+
<div class="dropdown-content">
|
123
|
+
<div class="dropdown-item">
|
124
|
+
<div class="field has-addons mr-1">
|
125
|
+
<p class="control is-expanded">
|
126
|
+
<input class="input is-small" type="text" aria-label="Query Input" style="height: 100%">
|
127
|
+
</p>
|
128
|
+
<p class="control">
|
129
|
+
<button id="order-selection-reset" class="button is-small has-icon" style="box-shadow: none;">
|
130
|
+
<span class="icon"><i class="fas fa-arrow-rotate-left"></i></span>
|
131
|
+
</button>
|
132
|
+
</p>
|
133
|
+
</div>
|
134
|
+
</div>
|
135
|
+
<div id="order-path-apply" hx-get="" hx-trigger="click" hx-replace-url="true"
|
136
|
+
hx-select-oob="#content,#order-path-apply,#list-pagination">
|
130
137
|
</div>
|
131
|
-
</div>
|
132
|
-
<div id="order-path-apply" hx-get="" hx-trigger="click" hx-replace-url="true"
|
133
|
-
hx-select-oob="#content,#order-path-apply,#list-pagination">
|
134
138
|
</div>
|
135
139
|
</div>
|
136
140
|
</div>
|
137
|
-
|
141
|
+
{% endif %}
|
138
142
|
</div>
|
139
143
|
</div>
|
accrete/managers.py
CHANGED
@@ -21,12 +21,17 @@ class TenantManager(models.Manager, AnnotationManagerMixin):
|
|
21
21
|
unique_fields=None,
|
22
22
|
):
|
23
23
|
tenant = get_tenant()
|
24
|
-
if tenant is None and
|
24
|
+
if tenant is None and any(obj.tenant_id in (False, None) for obj in objs):
|
25
25
|
raise ValueError(
|
26
26
|
'Tenant must be set for all objects when calling bulk_create'
|
27
27
|
)
|
28
|
-
for obj in objs:
|
29
|
-
|
28
|
+
if tenant is not None and any(obj.tenant_id != tenant.pk for obj in objs):
|
29
|
+
raise ValueError(
|
30
|
+
'Objects must have set the same Tenant when calling bulk_create while a tenant is active'
|
31
|
+
)
|
32
|
+
elif tenant is not None:
|
33
|
+
for obj in objs:
|
34
|
+
obj.tenant_id = tenant.pk
|
30
35
|
return super().bulk_create(
|
31
36
|
objs, batch_size=batch_size, ignore_conflicts=ignore_conflicts,
|
32
37
|
update_conflicts=update_conflicts, update_fields=update_fields,
|
accrete/utils/log.py
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
import logging
|
2
|
+
from functools import wraps
|
3
|
+
from timeit import default_timer as timer
|
4
|
+
|
5
|
+
_logger = logging.getLogger(__name__)
|
6
|
+
|
7
|
+
|
8
|
+
def log_time(f):
|
9
|
+
@wraps(f)
|
10
|
+
def decorator(*args, **kwargs):
|
11
|
+
start = timer()
|
12
|
+
result = f(*args, **kwargs)
|
13
|
+
stop = timer()
|
14
|
+
_logger.info(f'{f.__module__}.{f.__name__} Duration: {(stop - start)} Seconds')
|
15
|
+
return result
|
16
|
+
return decorator
|
@@ -4,7 +4,7 @@ accrete/annotation.py,sha256=GCpTTX3fJH9w2vOOOydKcAALdEd1gRNjh_Ws9LkJ4aA,1355
|
|
4
4
|
accrete/apps.py,sha256=F7ynMLHJr_6bRujWtZVUzCliY2CGKiDvyUmL4F68L2E,146
|
5
5
|
accrete/config.py,sha256=eJUbvyBO3DvAD6xkVKjTAzlXy7V7EK9bVyb91girfUs,299
|
6
6
|
accrete/forms.py,sha256=2vUh80qNvPDD8Zl3agKBSJEQeY7bXVLOx_SAB34wf8E,1359
|
7
|
-
accrete/managers.py,sha256=
|
7
|
+
accrete/managers.py,sha256=R-n2WRezhTNE-EVvhNSJ6TSCroN_TAHAWSJ_SS2jxpk,1451
|
8
8
|
accrete/middleware.py,sha256=NhtT3YPq0EynAi4F81LLLUZd5rsWDjGVn1tkgUObT3M,3477
|
9
9
|
accrete/models.py,sha256=xliEVR0XPW46ZDJn3-F46s54tG9dxz7BVLbkq1pC144,5434
|
10
10
|
accrete/storage.py,sha256=z7pHdQFw0hFGrrbfqIh7KFxabQ_JGqoPebmiX9TLmeU,1254
|
@@ -178,7 +178,7 @@ accrete/contrib/ui/templates/ui/form.html,sha256=uCtP16THdOuRfs3JdsjadIW0k9b2rN3
|
|
178
178
|
accrete/contrib/ui/templates/ui/layout.html,sha256=qUACs0vR3xn5gjoJly_zexdw9XEzu_EdF2Is6y-CvJM,15649
|
179
179
|
accrete/contrib/ui/templates/ui/list.html,sha256=ahN8SgF4kE3OEy6EBeDBdDQvuXx-CyIgbixYd-KdV4k,1751
|
180
180
|
accrete/contrib/ui/templates/ui/table.html,sha256=8ELtgxoapCyNsvmGISAGXe712lG6AkP_nekb4OVLK3I,4481
|
181
|
-
accrete/contrib/ui/templates/ui/partials/filter.html,sha256=
|
181
|
+
accrete/contrib/ui/templates/ui/partials/filter.html,sha256=fMxi5L1daqKElzZpHg8bItv0FlBjOkAEBxmT_OXgg4M,7434
|
182
182
|
accrete/contrib/ui/templates/ui/partials/form_errors.html,sha256=C5ktasYff2xBTiWfM6QR8qaGKSyK9QufB3B9N77KGpg,1386
|
183
183
|
accrete/contrib/ui/templates/ui/partials/header.html,sha256=wBiyo02mON3z7l4hJAPTAJn_vDhekYZ-a0g8TuW4RmY,7015
|
184
184
|
accrete/contrib/ui/templates/ui/partials/modal.html,sha256=Lk7ViKJS99QLjGFHKna90j6VUo_U03IDAT1Rq__QVLU,1472
|
@@ -230,9 +230,10 @@ accrete/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuF
|
|
230
230
|
accrete/utils/__init__.py,sha256=BZiTZDicA1--ruZUvI_bjvPUSwI4SxfqGJc9V5n9nQc,271
|
231
231
|
accrete/utils/dates.py,sha256=apM6kt6JhGrKgoT0jfav1W-8AUVTxNc9xt3fJQ2n0JI,1492
|
232
232
|
accrete/utils/forms.py,sha256=IvxbXNpSd4a-JBgsTJhs2GHe-DCRWX-xnVPRcoiCzbI,3104
|
233
|
+
accrete/utils/log.py,sha256=BH0MBDweAjx30wGBO4F3sFhbgkSoEs7T1lLLjlYZNnA,407
|
233
234
|
accrete/utils/models.py,sha256=EEhv7-sQVtQD24PEb3XcDUAh3VVhVFoMMLyFrDjGEaI,706
|
234
235
|
accrete/utils/views.py,sha256=iWZSYbd3qYMrV9wAsX26ofGb5wxn1N_nRrQ6s2lpp2I,4557
|
235
|
-
accrete-0.0.
|
236
|
-
accrete-0.0.
|
237
|
-
accrete-0.0.
|
238
|
-
accrete-0.0.
|
236
|
+
accrete-0.0.97.dist-info/METADATA,sha256=obrYnpP2ESdIu5uE0B0Wp6gjlJtUwf4sy2QUGv7ZSN4,4952
|
237
|
+
accrete-0.0.97.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
238
|
+
accrete-0.0.97.dist-info/licenses/LICENSE,sha256=_7laeMIHnsd3Y2vJEXDYXq_PEXxIcjgJsGt8UIKTRWc,1057
|
239
|
+
accrete-0.0.97.dist-info/RECORD,,
|
File without changes
|
File without changes
|