django-smartbase-admin 0.2.85__py3-none-any.whl → 0.2.87__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.
@@ -121,6 +121,7 @@ from django_smartbase_admin.engine.admin_base_view import (
121
121
  from django_smartbase_admin.engine.const import (
122
122
  OBJECT_ID_PLACEHOLDER,
123
123
  TRANSLATIONS_SELECTED_LANGUAGES,
124
+ ROW_CLASS_FIELD,
124
125
  )
125
126
  from django_smartbase_admin.services.translations import SBAdminTranslationsService
126
127
  from django_smartbase_admin.services.views import SBAdminViewService
@@ -909,6 +910,21 @@ class SBAdminInline(
909
910
  ordering = None
910
911
  all_base_fields_form = None
911
912
 
913
+ def get_readonly_fields(self, request, obj=None):
914
+ readonly_fields = super().get_readonly_fields(request, obj)
915
+ if ROW_CLASS_FIELD not in readonly_fields:
916
+ readonly_fields += (ROW_CLASS_FIELD,)
917
+ return readonly_fields
918
+
919
+ def get_fields(self, request, obj=None):
920
+ fields = super().get_fields(request, obj)
921
+ if ROW_CLASS_FIELD not in fields:
922
+ fields += (ROW_CLASS_FIELD,)
923
+ return fields
924
+
925
+ def get_sbadmin_row_class(self, obj):
926
+ return ""
927
+
912
928
  def get_ordering(self, request) -> tuple[str]:
913
929
  """
914
930
  Hook for specifying field ordering.
@@ -269,6 +269,8 @@ class SBAdminAttributesWidget(SBAdminTextInputWidget):
269
269
  dict_widgets = []
270
270
  template_widget = {"attrs": {"class": "input"}}
271
271
  if widget and value:
272
+ if isinstance(value, str):
273
+ value = json.loads(value)
272
274
  dict_widgets = [
273
275
  {
274
276
  "key": {"value": key, **template_widget},
@@ -72,3 +72,4 @@ DETAIL_STRUCTURE_RIGHT_CLASS = "detail-structure-right"
72
72
  TRANSLATIONS_SELECTED_LANGUAGES = "translation_selected_languages"
73
73
  OVERRIDE_CONTENT_OF_NOTIFICATION = "override_notification_content"
74
74
  FIELDSET_HIDE_HEADER_CLASS = "hide-header"
75
+ ROW_CLASS_FIELD = "get_sbadmin_row_class"
@@ -64,7 +64,7 @@ class ListActionModalView(ActionModalView):
64
64
  return response
65
65
 
66
66
  def get_selection_queryset(self, request, form):
67
- list_action = SBAdminListAction(self.view, request)
67
+ list_action = self.view.sbadmin_list_action_class(self.view, request)
68
68
  return list_action.get_data_queryset().filter(
69
69
  list_action.get_selection_queryset()
70
70
  )