Skip to content

Commit

Permalink
Passing no params to ImageAdminField is fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Anislav committed May 4, 2017
1 parent f3e9501 commit c6e9194
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ With **django-admin-easy** you can easily create this field with less lines:
fields = ('sum_method', 'some_img', 'is_true')
sum_method = easy.SimpleAdminField(lambda obj: '<b>%s</b>' % (obj.field1 + obj.field2 + obj.field3), 'Sum', 'field1', True)
some_img = easy.ImageAdminField('image', 'id')
some_img = easy.ImageAdminField('image')
is_true = easy.BooleanAdminField('Positive', 'value')
If you still prefer using a custom method, you can use our decorators, like this:
Expand Down
2 changes: 1 addition & 1 deletion easy/admin/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class ImageAdminField(BaseAdminField):

def __init__(self, attr, params=None, short_description=None, admin_order_field=None):
self.attr = attr
self.params = params
self.params = params or {}
super(ImageAdminField, self).__init__(short_description or attr, admin_order_field, True)

def render(self, obj):
Expand Down

0 comments on commit c6e9194

Please sign in to comment.