File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -25,8 +25,8 @@ def to_python(self, value):
25
25
return result
26
26
27
27
28
- class TopicAdminForm (forms .ModelForm ):
29
- metadata = DictOnlyJSONField (required = False )
28
+ class MetadataForm (forms .ModelForm ):
29
+ metadata = DictOnlyJSONField (required = False , initial = dict )
30
30
31
31
class Meta :
32
32
model = Topic
@@ -67,6 +67,7 @@ class ProductAdmin(admin.ModelAdmin):
67
67
readonly_fields = ("id" ,)
68
68
prepopulated_fields = {"slug" : ("title" ,)}
69
69
list_filter = (ArchivedFilter ,)
70
+ form = MetadataForm
70
71
71
72
def changelist_view (self , request , extra_context = None ):
72
73
if "is_archived" not in request .GET :
@@ -90,7 +91,7 @@ def parent(obj):
90
91
def get_products (obj ):
91
92
return ", " .join ([p .title for p in obj .products .all ()])
92
93
93
- form = TopicAdminForm
94
+ form = MetadataForm
94
95
95
96
parent .short_description = "Parent" # type: ignore
96
97
get_products .short_description = "Products" # type: ignore
You can’t perform that action at this time.
0 commit comments