django-smartbase-admin 1.0.2__py3-none-any.whl → 1.0.4b1__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.
@@ -205,9 +205,7 @@ class SBAdminDateWidget(SBAdminBaseWidget, forms.DateInput):
205
205
  "flatpickrOptions": {
206
206
  "dateFormat": "Y-m-d",
207
207
  "altInput": True,
208
- "altFormat": get_format(
209
- "SHORT_DATE_FORMAT", use_l10n=settings.USE_L10N
210
- ),
208
+ "altFormat": get_format("SHORT_DATE_FORMAT"),
211
209
  },
212
210
  },
213
211
  cls=SBAdminJSONEncoder,
@@ -77,6 +77,9 @@ class SBAdminFakeInlineMixin:
77
77
 
78
78
  def get_formset(self, request, obj=None, **kwargs):
79
79
  formset = super().get_formset(request, obj, **kwargs)
80
+ fake_fk = models.ForeignKey(self.original_model, on_delete=models.SET_NULL)
81
+ fake_fk.set_attributes_from_name("inline_fake_relationship")
82
+ formset.fk = fake_fk
80
83
  formset.queryset = self.get_queryset(request)
81
84
  formset.original_model = self.original_model
82
85
  formset.inline_instance = self
@@ -1,5 +1,13 @@
1
1
  from django.core.exceptions import FieldDoesNotExist, FieldError, ImproperlyConfigured
2
- from django.db.models import Count, Value, CharField, F, DateTimeField, BooleanField
2
+ from django.db.models import (
3
+ Count,
4
+ Value,
5
+ CharField,
6
+ F,
7
+ DateTimeField,
8
+ BooleanField,
9
+ FilteredRelation,
10
+ )
3
11
  from django.db.models.functions import Concat
4
12
 
5
13
  from django_smartbase_admin.engine.const import ANNOTATE_KEY, Formatter
@@ -268,5 +276,11 @@ class SBAdminField(JSONSerializableMixin):
268
276
  else:
269
277
  field_annotates[self.field] = Value(None, output_field=CharField())
270
278
  if self.supporting_annotates:
271
- supporting_annotates.update(self.supporting_annotates)
279
+ for key, value in self.supporting_annotates.items():
280
+ # workaround for a django bug
281
+ # https://code.djangoproject.com/ticket/36442#ticket
282
+ if isinstance(value, FilteredRelation):
283
+ supporting_annotates[key] = value.clone()
284
+ else:
285
+ supporting_annotates[key] = value
272
286
  return {**supporting_annotates, **field_annotates}
@@ -11,14 +11,14 @@
11
11
  <title>{% block title %}SBAdmin{% endblock %}</title>
12
12
 
13
13
  {% block icons %}
14
- <link rel="apple-touch-icon" sizes="180x180" href="{% static 'favicon/apple-touch-icon.png' %}">
15
- <link rel="icon" type="image/png" sizes="32x32" href="{% static 'favicon/favicon-32x32.png' %}">
16
- <link rel="icon" type="image/png" sizes="16x16" href="{% static 'favicon/favicon-16x16.png' %}">
17
- <link rel="manifest" href="{% static 'favicon/site.webmanifest' %}">
18
- <link rel="mask-icon" href="{% static 'favicon/safari-pinned-tab.svg' %}" color="#e0004d">
19
- <link rel="shortcut icon" href="{% static 'favicon/favicon.ico' %}">
14
+ <link rel="apple-touch-icon" sizes="180x180" href="{% static 'sb_admin/favicon/apple-touch-icon.png' %}">
15
+ <link rel="icon" type="image/png" sizes="32x32" href="{% static 'sb_admin/favicon/favicon-32x32.png' %}">
16
+ <link rel="icon" type="image/png" sizes="16x16" href="{% static 'sb_admin/favicon/favicon-16x16.png' %}">
17
+ <link rel="manifest" href="{% static 'sb_admin/favicon/site.webmanifest' %}">
18
+ <link rel="mask-icon" href="{% static 'sb_admin/favicon/safari-pinned-tab.svg' %}" color="#e0004d">
19
+ <link rel="shortcut icon" href="{% static 'sb_admin/favicon/favicon.ico' %}">
20
20
  <meta name="msapplication-TileColor" content="#e0004d">
21
- <meta name="msapplication-config" content="{% static 'favicon/browserconfig.xml' %}">
21
+ <meta name="msapplication-config" content="{% static 'sb_admin/favicon/browserconfig.xml' %}">
22
22
  <meta name="theme-color" content="#ffffff">
23
23
  {% endblock %}
24
24
  <link rel="stylesheet" href="{% static 'sb_admin/dist/main_style.css' %}">
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: django-smartbase-admin
3
- Version: 1.0.2
3
+ Version: 1.0.4b1
4
4
  Summary:
5
5
  Author: SmartBase
6
6
  Author-email: info@smartbase.sk
@@ -5,7 +5,7 @@ django_smartbase_admin/actions/advanced_filters.py,sha256=Vm8b6TAwNehR8INjolFG7p
5
5
  django_smartbase_admin/admin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  django_smartbase_admin/admin/admin_base.py,sha256=Dnql1LQVeJWla3ItuHbVgakUXT3apUfWvWc9MmundsQ,41765
7
7
  django_smartbase_admin/admin/site.py,sha256=VrJBhwgZsLa2GohvjnNL7m4dVR3S4Ou1V1UzfE1qOoQ,6577
8
- django_smartbase_admin/admin/widgets.py,sha256=LRrjZC79xfPWQOxwH3aGQB6s8UTvyqFGCXpH9vUwNKw,22730
8
+ django_smartbase_admin/admin/widgets.py,sha256=rACFas2qt4-uWnQHQnsAMy-0sT5tsGzxRyyeWXWawM4,22656
9
9
  django_smartbase_admin/apps.py,sha256=C1wT1YUEZNKcUJfpD01nIZEFgYEsuav52WFKvEURRDU,545
10
10
  django_smartbase_admin/compilemessages.py,sha256=-_FEFQlOvE4L8UzSuUxSxZQjgGlwL9IZtmg59fW_kIQ,342
11
11
  django_smartbase_admin/engine/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -16,8 +16,8 @@ django_smartbase_admin/engine/admin_view.py,sha256=9wGffahDR3IYmhL9ZbX8uitwGdXdw
16
16
  django_smartbase_admin/engine/configuration.py,sha256=P3iSiPm9QBl9etTDJIWzo7DzOBCryGwWtbF288PEtus,8120
17
17
  django_smartbase_admin/engine/const.py,sha256=0-MZFCce8UnTHaL6tkezMXUf4S2ZoSc5HRGi-T7KcHU,2479
18
18
  django_smartbase_admin/engine/dashboard.py,sha256=wrvX0GI-SII2pG0DX8Kvy4JFaM6h8e6R7KSCFddFC64,23642
19
- django_smartbase_admin/engine/fake_inline.py,sha256=9C2_mltg2P9-xa3vuoo5X_RcFaCRpKGNSy7t1_iiasE,5802
20
- django_smartbase_admin/engine/field.py,sha256=CzQN_9mYTsnJ6B1HebrGCWLx3RLUZsGmzRuCa1v0fu4,10173
19
+ django_smartbase_admin/engine/fake_inline.py,sha256=mTnohS1E2rPJSwDupQwzylSxA3bAGeV0hbRrsppWGjQ,5984
20
+ django_smartbase_admin/engine/field.py,sha256=9yZfrc1UGqXoHhhBy08yLSjQB5ptfn9B-FQUDCcWtNc,10531
21
21
  django_smartbase_admin/engine/field_formatter.py,sha256=Ma4GoO2DMgCtx-zy_hgyW_095GWwflMdn8uN4GUatgw,2087
22
22
  django_smartbase_admin/engine/filter_widgets.py,sha256=mrygiz55wyJzZZUx3QlbVHb4IQrt5YpYcWkWf9JFN5M,31124
23
23
  django_smartbase_admin/engine/global_filter_form.py,sha256=jlj6e9VYWDPyUNjcgj3gTIkCZXO01NZOWAeU3jFtkoA,249
@@ -622,7 +622,7 @@ django_smartbase_admin/templates/sb_admin/partials/messages/alert_warning.html,s
622
622
  django_smartbase_admin/templates/sb_admin/partials/modal/modal.html,sha256=SaJkpGaEa_hSSmfL4yqrXfMOf3rvNsF6G2vOX6ngpJw,1508
623
623
  django_smartbase_admin/templates/sb_admin/partials/modal/modal_content.html,sha256=_1wrb2GsCvtwQPDl5CUVRgFdcsor25ceHi8UDsPAWt8,3251
624
624
  django_smartbase_admin/templates/sb_admin/sb_admin_base.html,sha256=wVwA5Gv9c_M6rRXIWglu9jFaEwC0NCprniYuaHO19qA,741
625
- django_smartbase_admin/templates/sb_admin/sb_admin_base_no_sidebar.html,sha256=-8NTw-o33FPoJxkyPB12OdRemDLXjwDbhgWHSe009DA,4177
625
+ django_smartbase_admin/templates/sb_admin/sb_admin_base_no_sidebar.html,sha256=1lwpPQBxyLw3sn-W6h3ugjnsVsZ2kBck-ztfOFDb-6Q,4240
626
626
  django_smartbase_admin/templates/sb_admin/sb_admin_js_trans.html,sha256=9oSkJo6Ngwr5T8zkpn6GLcdXNTMa1A7SmgjTlg9jlzY,926
627
627
  django_smartbase_admin/templates/sb_admin/sprites/sb_admin.svg,sha256=CIjRhZaa7k4WJestFSDIUYWN4FWyeCQe_ahw5-N-vK8,60715
628
628
  django_smartbase_admin/templates/sb_admin/submit_line.html,sha256=cslitlZCL2UlRI8fyEftpSHoVTAX2eqC-oVkfulxZWU,3254
@@ -681,7 +681,7 @@ django_smartbase_admin/views/dashboard_view.py,sha256=vtz5emYTQ5WDFeLA8HrcmjSOVd
681
681
  django_smartbase_admin/views/global_filter_view.py,sha256=eYo1moJGyi7jc2cPDA5ZBiEgA7Hmc-DxbQvbqUpDkg8,1127
682
682
  django_smartbase_admin/views/media_view.py,sha256=5BLWXuzynF7nM34t-mf2BQSRN5ojY8HxpLIqt7Jiq9g,292
683
683
  django_smartbase_admin/views/translations_view.py,sha256=tkShf5IWyPDjNhcPQsvh8WXs-EMRCfG_oTD9x-LP1No,20272
684
- django_smartbase_admin-1.0.2.dist-info/LICENSE.md,sha256=okRGMBOYvyhprt2eTpX_QXqpzC0MODF-U7zX-4fKPjQ,1078
685
- django_smartbase_admin-1.0.2.dist-info/METADATA,sha256=TIDTwzqP5D6cGUY4x-RKI1Mu8FkJjK6eH2zgdCoCnes,4807
686
- django_smartbase_admin-1.0.2.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
687
- django_smartbase_admin-1.0.2.dist-info/RECORD,,
684
+ django_smartbase_admin-1.0.4b1.dist-info/LICENSE.md,sha256=okRGMBOYvyhprt2eTpX_QXqpzC0MODF-U7zX-4fKPjQ,1078
685
+ django_smartbase_admin-1.0.4b1.dist-info/METADATA,sha256=wHSXnvxrqrENYi4x31-Ou5fzBiHrNeI0LyCSt5rsLHQ,4809
686
+ django_smartbase_admin-1.0.4b1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
687
+ django_smartbase_admin-1.0.4b1.dist-info/RECORD,,