diff options
author | luxagraf <sng@luxagraf.net> | 2018-09-02 10:20:23 -0600 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2018-09-02 10:20:23 -0600 |
commit | 0aef0852228b0d32981379a0fe6cc1847e7524ea (patch) | |
tree | 2b00186b33822483093dee287e2acef6b7662864 /app/jrnl/admin.py | |
parent | 0e15bfaaa7b2ded3af49911f0c3cbeaec55a653c (diff) |
fixed admin widget
Diffstat (limited to 'app/jrnl/admin.py')
-rw-r--r-- | app/jrnl/admin.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/jrnl/admin.py b/app/jrnl/admin.py index 94759c0..52ab083 100644 --- a/app/jrnl/admin.py +++ b/app/jrnl/admin.py @@ -100,9 +100,15 @@ class HomepageCurratorAdmin(admin.ModelAdmin): @admin.register(Home) class HomeAdmin(admin.ModelAdmin): - form = GalleryForm filter_horizontal = ('popular',) + def formfield_for_dbfield(self, db_field, **kwargs): + if db_field.name == 'thumbnail' or db_field.name == 'image': + field = forms.FileField(widget=AdminImageWidget) + else: + field = super(EntryAdmin, self).formfield_for_dbfield(db_field, **kwargs) + return field + class Media: js = ('image-loader.js', 'next-prev-links.js') css = { |