Skip to content

Commit

Permalink
Fix ModelForm with django-money addition
Browse files Browse the repository at this point in the history
  • Loading branch information
cachitas committed Mar 19, 2019
1 parent 9d34c9c commit 11dfde9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pyforms_web/widgets/django/modelform.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,10 @@ def show_edit_form(self, pk=None):
else:
pyforms_field.value = value

elif isinstance(field, models.DecimalField) and type(field).__name__ == 'MoneyField':
# support django-money MoneyField
pyforms_field.value = value.amount

elif isinstance(field, models.AutoField):
pyforms_field.value = value

Expand Down

0 comments on commit 11dfde9

Please sign in to comment.