accrete 0.0.90__py3-none-any.whl → 0.0.92__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/annotation.py +6 -3
- accrete/contrib/ui/static/css/accrete.css +1 -1
- accrete/contrib/ui/static/css/accrete.scss +1 -1
- accrete/contrib/ui/templates/ui/layout.html +1 -1
- accrete/contrib/ui/templates/ui/list.html +2 -2
- accrete/managers.py +1 -1
- accrete/models.py +6 -1
- {accrete-0.0.90.dist-info → accrete-0.0.92.dist-info}/METADATA +2 -2
- {accrete-0.0.90.dist-info → accrete-0.0.92.dist-info}/RECORD +11 -11
- {accrete-0.0.90.dist-info → accrete-0.0.92.dist-info}/WHEEL +0 -0
- {accrete-0.0.90.dist-info → accrete-0.0.92.dist-info}/licenses/LICENSE +0 -0
accrete/annotation.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from django.db.models import Field
|
1
|
+
from django.db.models import Field, Subquery, OuterRef
|
2
2
|
from django.db.models.expressions import Func
|
3
3
|
from django.db.models.aggregates import Aggregate
|
4
4
|
|
@@ -34,10 +34,13 @@ class AnnotationModelMixin:
|
|
34
34
|
|
35
35
|
class AnnotationManagerMixin:
|
36
36
|
|
37
|
-
def get_annotations(self):
|
37
|
+
def get_annotations(self, queryset):
|
38
38
|
if not hasattr(self.model, 'get_annotations'):
|
39
39
|
return {}
|
40
40
|
return {
|
41
|
-
annotation['name']:
|
41
|
+
annotation['name']: Subquery(
|
42
|
+
queryset.annotate(**{
|
43
|
+
annotation['name']: annotation['annotation'].function
|
44
|
+
}).filter(pk=OuterRef('pk')).values(annotation['name'])[:1])
|
42
45
|
for annotation in self.model.get_annotations()
|
43
46
|
}
|
@@ -20636,7 +20636,7 @@ td {
|
|
20636
20636
|
background-color: var(--accrete-field-bg-color);
|
20637
20637
|
}
|
20638
20638
|
|
20639
|
-
.label.has-field * .button {
|
20639
|
+
.label.has-field * .button:not(.label-button) {
|
20640
20640
|
border-top: transparent;
|
20641
20641
|
border-right: transparent;
|
20642
20642
|
border-left: transparent;
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
12
12
|
{% block favicon %}<link rel="icon" type="image/svg" href="{% static 'icons/accrete.svg' %}"/>{% endblock %}
|
13
13
|
{% block style %}
|
14
|
-
<link rel="stylesheet" type="text/css" href="{% static "css/accrete.css" %}?v=0.0.
|
14
|
+
<link rel="stylesheet" type="text/css" href="{% static "css/accrete.css" %}?v=0.0.91">
|
15
15
|
<link rel="stylesheet" type="text/css" href="{% static "css/icons.css" %}">
|
16
16
|
<link rel="stylesheet" type="text/css" href="{% static "css/fa.css" %}">
|
17
17
|
{% endblock %}
|
@@ -7,7 +7,7 @@
|
|
7
7
|
{% block content %}
|
8
8
|
<div class="columns is-multiline">
|
9
9
|
{% for obj in list_page %}
|
10
|
-
<div class="list-column column is-{{ column_width }}-fullhd is-{{ column_width_widescreen }}-widescreen is-{{ column_width_desktop }}-desktop is-12-touch"
|
10
|
+
<div class="list-column column pb-0 is-{{ column_width }}-fullhd is-{{ column_width_widescreen }}-widescreen is-{{ column_width_desktop }}-desktop is-12-touch"
|
11
11
|
style="height: {{ column_height }}{{ column_height_unit }}"
|
12
12
|
{% if endless_scroll and forloop.last and list_page.has_next %}
|
13
13
|
hx-get="{{ pagination_param_str }}&page={{ list_page.next_page_number }}"
|
@@ -19,7 +19,7 @@
|
|
19
19
|
{% endif %}
|
20
20
|
>
|
21
21
|
<div class="box is-hoverable p-3"
|
22
|
-
style="word-break: break-word; height: 100%; border: var(--accrete-box-border); overflow-y: auto; {% if obj.get_absolute_url %}cursor:pointer;{% endif %}"
|
22
|
+
style="word-break: break-word; height: 100%; border: var(--accrete-box-border); overflow-y: auto; {% if obj.get_absolute_url %}cursor:pointer;{% endif %}"
|
23
23
|
{% if obj.get_absolute_url %}hx-get="{{ obj.get_absolute_url }}{{ object_param_str }}" hx-target="body" hx-push-url="true" {% endif %}
|
24
24
|
>
|
25
25
|
{% block data %}
|
accrete/managers.py
CHANGED
@@ -9,7 +9,7 @@ class TenantManager(models.Manager, AnnotationManagerMixin):
|
|
9
9
|
queryset = super().get_queryset()
|
10
10
|
if tenant := get_tenant():
|
11
11
|
queryset = queryset.filter(tenant=tenant)
|
12
|
-
return queryset.annotate(**self.get_annotations())
|
12
|
+
return queryset.annotate(**self.get_annotations(queryset))
|
13
13
|
|
14
14
|
def bulk_create(
|
15
15
|
self,
|
accrete/models.py
CHANGED
@@ -21,7 +21,12 @@ class TenantModel(models.Model, AnnotationModelMixin):
|
|
21
21
|
objects = TenantManager()
|
22
22
|
|
23
23
|
def save(
|
24
|
-
self,
|
24
|
+
self,
|
25
|
+
*args,
|
26
|
+
force_insert=False,
|
27
|
+
force_update=False,
|
28
|
+
using=None,
|
29
|
+
update_fields=None
|
25
30
|
):
|
26
31
|
tenant = get_tenant()
|
27
32
|
if self.pk and tenant and self.tenant != tenant:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: accrete
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.92
|
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
|
@@ -31,7 +31,7 @@ Classifier: Operating System :: OS Independent
|
|
31
31
|
Classifier: Programming Language :: Python :: 3
|
32
32
|
Classifier: Topic :: Internet :: WWW/HTTP
|
33
33
|
Requires-Python: >=3.10
|
34
|
-
Requires-Dist: django>=
|
34
|
+
Requires-Dist: django>=5.1
|
35
35
|
Provides-Extra: contrib
|
36
36
|
Requires-Dist: celery>=5.3.4; extra == 'contrib'
|
37
37
|
Requires-Dist: django-celery-beat; extra == 'contrib'
|
@@ -1,12 +1,12 @@
|
|
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=
|
3
|
+
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=vODaKmWPvgfRoYXbQ_JD-pRjd2QWM_a9Gjkllrua0WE,1164
|
8
8
|
accrete/middleware.py,sha256=IABs2pAV-kXjp3n5_Wsc7reXGjU5FhmCbvFB8cC4ZRM,3422
|
9
|
-
accrete/models.py,sha256=
|
9
|
+
accrete/models.py,sha256=xliEVR0XPW46ZDJn3-F46s54tG9dxz7BVLbkq1pC144,5434
|
10
10
|
accrete/storage.py,sha256=z7pHdQFw0hFGrrbfqIh7KFxabQ_JGqoPebmiX9TLmeU,1254
|
11
11
|
accrete/tenant.py,sha256=g3ZuTrQr2zqmIopNBRQeCmHEK2R3dlUme_hOV765J6U,1778
|
12
12
|
accrete/tests.py,sha256=Agltbzwwh5htvq_Qi9vqvxutzmg_GwgPS_N19xJZRlw,7197
|
@@ -145,9 +145,9 @@ accrete/contrib/ui/static/bulma/versions/bulma-no-dark-mode.scss,sha256=w6Q80mCV
|
|
145
145
|
accrete/contrib/ui/static/bulma/versions/bulma-no-helpers-prefixed.scss,sha256=6HCUc4hxyaj4_rHqUnoy7aMuFZECHDYh5jvp-1CEtfE,344
|
146
146
|
accrete/contrib/ui/static/bulma/versions/bulma-no-helpers.scss,sha256=5dzAXSgReWUO8GXLbYTpOclPPD0xqvvBiCCX_GOR_5U,313
|
147
147
|
accrete/contrib/ui/static/bulma/versions/bulma-prefixed.scss,sha256=Yj7oEO00jy_G_L32y6rwzp2P5p2YtQ2Pvq4aZhvBSE8,138
|
148
|
-
accrete/contrib/ui/static/css/accrete.css,sha256=
|
148
|
+
accrete/contrib/ui/static/css/accrete.css,sha256=BxRjOCczt1i0mAvqWMeRZkm0uzyRHxzCDsYHOpl4aYU,606629
|
149
149
|
accrete/contrib/ui/static/css/accrete.css.map,sha256=2OtQtNJXftZNePoK3IDrLhD3QbVkzMY6q9DKHXssT0Q,94573
|
150
|
-
accrete/contrib/ui/static/css/accrete.scss,sha256=
|
150
|
+
accrete/contrib/ui/static/css/accrete.scss,sha256=kLtGfEySI5EFo1xqIP26tFXxWkMLmlA3J3SdO4E-5Kw,12072
|
151
151
|
accrete/contrib/ui/static/css/fa.css,sha256=wiz7ZSCn_btzhjKDQBms9Hx4sSeUYsDrTLg7roPstac,102641
|
152
152
|
accrete/contrib/ui/static/css/icons.css,sha256=5550KHsaayeEtRaUdf0h7esQhyec-_5ZfecZ_sOC6v0,6334
|
153
153
|
accrete/contrib/ui/static/icons/Logo.svg,sha256=hGZuxrAa-LRpFavFiF8Lnc7X9OQcqmb6Xl_dxx-27hM,1861
|
@@ -175,8 +175,8 @@ accrete/contrib/ui/templates/django/forms/widgets/textarea.html,sha256=c9BTedqb3
|
|
175
175
|
accrete/contrib/ui/templates/ui/dashboard.html,sha256=udnwiSJEcn2wMaJfTs4P0Y20FU79VguK_9Lq4K2BqtM,160
|
176
176
|
accrete/contrib/ui/templates/ui/detail.html,sha256=-Nksyufbf4onufqmFGTAW_BxLRNSWv1A9n8Qs2a6aCo,564
|
177
177
|
accrete/contrib/ui/templates/ui/form.html,sha256=uCtP16THdOuRfs3JdsjadIW0k9b2rN3GAsRSTfSUWak,691
|
178
|
-
accrete/contrib/ui/templates/ui/layout.html,sha256=
|
179
|
-
accrete/contrib/ui/templates/ui/list.html,sha256=
|
178
|
+
accrete/contrib/ui/templates/ui/layout.html,sha256=0exf4WLB9Ns9KvP3q5GZRtwf4yzIOQZmYTTj1AAv_Xo,15649
|
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
181
|
accrete/contrib/ui/templates/ui/partials/filter.html,sha256=2vmeL3980rMmkRnmVtZh9mBHe6S0PTMjaGIN1J6SpNM,7184
|
182
182
|
accrete/contrib/ui/templates/ui/partials/form_errors.html,sha256=C5ktasYff2xBTiWfM6QR8qaGKSyK9QufB3B9N77KGpg,1386
|
@@ -232,7 +232,7 @@ accrete/utils/dates.py,sha256=apM6kt6JhGrKgoT0jfav1W-8AUVTxNc9xt3fJQ2n0JI,1492
|
|
232
232
|
accrete/utils/forms.py,sha256=IvxbXNpSd4a-JBgsTJhs2GHe-DCRWX-xnVPRcoiCzbI,3104
|
233
233
|
accrete/utils/http.py,sha256=sUDwa9hpYAle7d0iJxIA5wQk2mK2BMENo7JyFBSPxKc,4475
|
234
234
|
accrete/utils/models.py,sha256=EEhv7-sQVtQD24PEb3XcDUAh3VVhVFoMMLyFrDjGEaI,706
|
235
|
-
accrete-0.0.
|
236
|
-
accrete-0.0.
|
237
|
-
accrete-0.0.
|
238
|
-
accrete-0.0.
|
235
|
+
accrete-0.0.92.dist-info/METADATA,sha256=qQWTwFVcTYzWGNz5a5Zl4IRkzL8oZRiLywbh4ueADSc,4952
|
236
|
+
accrete-0.0.92.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
237
|
+
accrete-0.0.92.dist-info/licenses/LICENSE,sha256=_7laeMIHnsd3Y2vJEXDYXq_PEXxIcjgJsGt8UIKTRWc,1057
|
238
|
+
accrete-0.0.92.dist-info/RECORD,,
|
File without changes
|
File without changes
|