Skip to content

Commit

Permalink
Merge pull request #189 from slav0nic/patch-1
Browse files Browse the repository at this point in the history
allow custom widget for parent field
  • Loading branch information
idlesign committed Sep 16, 2018
2 parents e603537 + b6242e8 commit 8722acb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sitetree/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ def get_form(self, request, obj=None, **kwargs):
form = super(TreeItemAdmin, self).get_form(request, obj, **kwargs)
my_choice_field.label = form.base_fields['parent'].label
my_choice_field.help_text = form.base_fields['parent'].help_text
my_choice_field.widget = form.base_fields['parent'].widget
# Replace 'parent' TreeItem field with new appropriate one
form.base_fields['parent'] = my_choice_field

Expand Down

0 comments on commit 8722acb

Please sign in to comment.