accrete 0.0.103__py3-none-any.whl → 0.0.104__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/context.py +4 -1
- accrete/contrib/ui/templates/ui/partials/table_field_tags.html +17 -0
- accrete/contrib/ui/templates/ui/widgets/model_search_select_multi.html +1 -1
- accrete/contrib/ui/templatetags/accrete_ui.py +2 -1
- {accrete-0.0.103.dist-info → accrete-0.0.104.dist-info}/METADATA +1 -2
- {accrete-0.0.103.dist-info → accrete-0.0.104.dist-info}/RECORD +8 -11
- {accrete-0.0.103.dist-info → accrete-0.0.104.dist-info}/WHEEL +1 -1
- accrete/contrib/ui/templates/ui/partials/table_field.html +0 -16
- accrete/contrib/ui/templates/ui/partials/table_field_float.html +0 -1
- accrete/contrib/ui/templates/ui/partials/table_field_monetary.html +0 -4
- accrete/contrib/ui/templates/ui/partials/table_field_string.html +0 -1
- {accrete-0.0.103.dist-info → accrete-0.0.104.dist-info}/licenses/LICENSE +0 -0
accrete/contrib/ui/context.py
CHANGED
@@ -334,13 +334,16 @@ def get_table_fields(
|
|
334
334
|
field_type = TableFieldType.NONE
|
335
335
|
if getattr(attr, 'choices', False):
|
336
336
|
field_type = TableFieldType.CHOICE_DISPLAY
|
337
|
-
|
337
|
+
table_field = TableField(
|
338
338
|
label=attr.verbose_name,
|
339
339
|
name=f_name,
|
340
340
|
field_type=field_type,
|
341
341
|
alignment=get_alignment(attr),
|
342
342
|
is_relation=is_relation
|
343
343
|
)
|
344
|
+
if hasattr(attr, 'get_internal_type') and attr.get_internal_type() == 'ManyToManyField':
|
345
|
+
table_field.template = 'ui/partials/table_field_tags.html'
|
346
|
+
return table_field
|
344
347
|
|
345
348
|
if field_definition is None:
|
346
349
|
field_definition = {}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
{% load accrete_ui %}
|
2
|
+
|
3
|
+
|
4
|
+
{% with manager=obj|get_attr:field.name %}
|
5
|
+
<td style="text-align: left">
|
6
|
+
<span>
|
7
|
+
<span class="responsive-heading has-text-weight-light" style="margin-right: .2rem">{{ field.label }}:</span>
|
8
|
+
{% block td_content %}
|
9
|
+
<div class="tags">
|
10
|
+
{% for o in manager.all %}
|
11
|
+
<span class="tag">{{ o }}</span>
|
12
|
+
{% endfor %}
|
13
|
+
</div>
|
14
|
+
{% endblock %}
|
15
|
+
</span>
|
16
|
+
</td>
|
17
|
+
{% endwith %}
|
@@ -24,7 +24,7 @@
|
|
24
24
|
</div>
|
25
25
|
</div>
|
26
26
|
<div style="position: relative; z-index: 90;">
|
27
|
-
<div x-show="open" class="box pt-1 mb-2" x-ref="dropdownContent" tabindex="-1" x-transition style="position: absolute; width: 100%;">
|
27
|
+
<div x-show="open" class="box pt-1 mb-2" x-ref="dropdownContent" x-cloak="" tabindex="-1" x-transition style="position: absolute; width: 100%;">
|
28
28
|
<input id="{{ widget.attrs.id }}_search" type="search" autocomplete="off" class="input" x-ref="searchInput" aria-label="search"
|
29
29
|
name="{{ widget.search_parameter }}"
|
30
30
|
placeholder="{% translate 'Type to search' %}"
|
@@ -38,6 +38,7 @@ def get_attr_from_field(obj: object, field: TableField):
|
|
38
38
|
if isinstance(attr, str):
|
39
39
|
return attr
|
40
40
|
return attr
|
41
|
+
|
41
42
|
f_name = field.name
|
42
43
|
if field.field_type == TableFieldType.CHOICE_DISPLAY:
|
43
44
|
f_name = f'get_{f_name}_display'
|
@@ -54,7 +55,7 @@ def get_attr_from_field(obj: object, field: TableField):
|
|
54
55
|
def get_attr_from_string(param: object, value: str):
|
55
56
|
|
56
57
|
def return_save(attr):
|
57
|
-
if isinstance(attr, Manager):
|
58
|
+
if isinstance(attr, Manager) and hasattr(attr, 'related_model'):
|
58
59
|
return attr.related_model
|
59
60
|
if attr is None:
|
60
61
|
return None
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: accrete
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.104
|
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
|
@@ -22,7 +22,6 @@ License: Copyright (c) 2023 Benedikt Jilek
|
|
22
22
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
23
23
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
24
24
|
SOFTWARE.
|
25
|
-
License-File: LICENSE
|
26
25
|
Classifier: Environment :: Web Environment
|
27
26
|
Classifier: Framework :: Django
|
28
27
|
Classifier: Intended Audience :: Developers
|
@@ -37,7 +37,7 @@ accrete/contrib/system_mail/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JC
|
|
37
37
|
accrete/contrib/ui/__init__.py,sha256=WmsbOxYjh2PpInP7-rHidgkjunGb8ujc5I1AL3anXTM,596
|
38
38
|
accrete/contrib/ui/admin.py,sha256=suMo4x8I3JBxAFBVIdE-5qnqZ6JAZV0FESABHOSc-vg,63
|
39
39
|
accrete/contrib/ui/apps.py,sha256=E0ao2ox6PQ3ldfeR17FXJUUJuGiWjm2DPCxHbPXGzls,152
|
40
|
-
accrete/contrib/ui/context.py,sha256=
|
40
|
+
accrete/contrib/ui/context.py,sha256=RzzD_UMf20zPp2rZdFOZ-DSy9dyoyxuIbeDi7xWMAWQ,10357
|
41
41
|
accrete/contrib/ui/elements.py,sha256=qfvlChTwr7hbTdxaNwpvQZJeykSvJl7IdBFfPqXvTPo,1998
|
42
42
|
accrete/contrib/ui/filter.py,sha256=f3L-ZKN5Yz3-iObYlRISNzz2Yvr9-TdMyydn_EY00M0,13917
|
43
43
|
accrete/contrib/ui/tests.py,sha256=mrbGGRNg5jwbTJtWWa7zSKdDyeB4vmgZCRc2nk6VY-g,60
|
@@ -183,17 +183,14 @@ accrete/contrib/ui/templates/ui/partials/modal_form.html,sha256=_2cvsihB1tIZ5ydh
|
|
183
183
|
accrete/contrib/ui/templates/ui/partials/onchange_form.html,sha256=8wNgZYnpa6ttc-OraOi1i02isJCcnaMtYwsmObc3qcY,109
|
184
184
|
accrete/contrib/ui/templates/ui/partials/pagination_detail.html,sha256=58nA3X7Il0FAD4VcYyr7tTGWRiVf_FN1TkImmKEpKHU,1014
|
185
185
|
accrete/contrib/ui/templates/ui/partials/pagination_list.html,sha256=Eyx1lsk9UIFFYPICL7RuYeUFaKVlmvWVXnFCGR-II7k,1324
|
186
|
-
accrete/contrib/ui/templates/ui/partials/
|
187
|
-
accrete/contrib/ui/templates/ui/partials/table_field_float.html,sha256=GH_jFdpk8wEJXv4QfO6c3URYrZGGLeuSyWwWl2cWxwQ,45
|
188
|
-
accrete/contrib/ui/templates/ui/partials/table_field_monetary.html,sha256=Wtod9vel2dD4vG8lUVLbtls4aU_2EG3p0E1QRRUSH10,166
|
189
|
-
accrete/contrib/ui/templates/ui/partials/table_field_string.html,sha256=GH_jFdpk8wEJXv4QfO6c3URYrZGGLeuSyWwWl2cWxwQ,45
|
186
|
+
accrete/contrib/ui/templates/ui/partials/table_field_tags.html,sha256=8EDeBZD3B5aWMd5U3UldqdpjhvEgOixRCybE6jrE0nc,530
|
190
187
|
accrete/contrib/ui/templates/ui/widgets/model_search_select.html,sha256=V0NQy8eymvwIAM3QTvOM7yOAmabRJ_DVqfLGv2Xbnt8,2856
|
191
|
-
accrete/contrib/ui/templates/ui/widgets/model_search_select_multi.html,sha256=
|
188
|
+
accrete/contrib/ui/templates/ui/widgets/model_search_select_multi.html,sha256=GKc9eWjaU1uzNeFiqFleTCz4VkUGzKxYKfCo4hzQpzc,4122
|
192
189
|
accrete/contrib/ui/templates/ui/widgets/model_search_select_multi_selected_options.html,sha256=1fDpCnotpGFH7bzqllwbVixH1DB1-akbso5eH8cL4iU,91
|
193
190
|
accrete/contrib/ui/templates/ui/widgets/model_search_select_multi_tags.html,sha256=FV2pc5qaJil19reZXWzLgrUlcXyugdwunZ12lv6COfg,231
|
194
191
|
accrete/contrib/ui/templates/ui/widgets/model_search_select_options.html,sha256=TECaTLnkmVoUZBhehLwcSjyfgwvhXX2ZBiqSro9ap_U,203
|
195
192
|
accrete/contrib/ui/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
196
|
-
accrete/contrib/ui/templatetags/accrete_ui.py,sha256=
|
193
|
+
accrete/contrib/ui/templatetags/accrete_ui.py,sha256=hWHbl5pNcchN5Kt5u4Lsu3MsRKUTBZzwesbWLIJzt34,3875
|
197
194
|
accrete/contrib/user/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
198
195
|
accrete/contrib/user/admin.py,sha256=YS4iApli7XUaIl9GsEJxys2j8sepX0by88omYHjff-E,85
|
199
196
|
accrete/contrib/user/apps.py,sha256=oHDrAiHf-G57mZLyxqGJzRY2DbPprGFD-QgyVJG_ruI,156
|
@@ -235,7 +232,7 @@ accrete/utils/forms.py,sha256=IvxbXNpSd4a-JBgsTJhs2GHe-DCRWX-xnVPRcoiCzbI,3104
|
|
235
232
|
accrete/utils/log.py,sha256=BH0MBDweAjx30wGBO4F3sFhbgkSoEs7T1lLLjlYZNnA,407
|
236
233
|
accrete/utils/models.py,sha256=EEhv7-sQVtQD24PEb3XcDUAh3VVhVFoMMLyFrDjGEaI,706
|
237
234
|
accrete/utils/views.py,sha256=iWZSYbd3qYMrV9wAsX26ofGb5wxn1N_nRrQ6s2lpp2I,4557
|
238
|
-
accrete-0.0.
|
239
|
-
accrete-0.0.
|
240
|
-
accrete-0.0.
|
241
|
-
accrete-0.0.
|
235
|
+
accrete-0.0.104.dist-info/METADATA,sha256=tk5aDpkDD58vu5If6vdRElbxwu2hp6BE8TsErQ6Zoko,4931
|
236
|
+
accrete-0.0.104.dist-info/WHEEL,sha256=wukiCwsxxsuzcQTdnC_ZWHZECE4wwOh3xCCrap6i6Ts,87
|
237
|
+
accrete-0.0.104.dist-info/licenses/LICENSE,sha256=_7laeMIHnsd3Y2vJEXDYXq_PEXxIcjgJsGt8UIKTRWc,1057
|
238
|
+
accrete-0.0.104.dist-info/RECORD,,
|
@@ -1,16 +0,0 @@
|
|
1
|
-
{% load accrete_ui %}
|
2
|
-
|
3
|
-
{% with val=obj|get_attr:field.name|default_if_none:'---' %}
|
4
|
-
<td style="text-align: {{ field.alignment.value }}" {% if val|length > field.truncate_after %}title="{{ val }}"{% endif %}>
|
5
|
-
<span class="responsive-heading has-text-weight-light" style="margin-right: .2rem">{{ field.label }}:</span>
|
6
|
-
{{ field.prefix }}
|
7
|
-
{% block td_content %}
|
8
|
-
{% if field.truncate_after > 0 %}
|
9
|
-
{{ val|truncatechars:field.truncate_after }}
|
10
|
-
{% else %}
|
11
|
-
{{ val }}
|
12
|
-
{% endif %}
|
13
|
-
{% endblock %}
|
14
|
-
{{ field.suffix }}
|
15
|
-
</td>
|
16
|
-
{% endwith %}
|
@@ -1 +0,0 @@
|
|
1
|
-
{% extends 'ui/partials/table_field.html' %}
|
@@ -1 +0,0 @@
|
|
1
|
-
{% extends 'ui/partials/table_field.html' %}
|
File without changes
|