Skip to content

Commit

Permalink
Merge 3ca3350 into ae1bb6e
Browse files Browse the repository at this point in the history
  • Loading branch information
Karmak23 committed Nov 22, 2014
2 parents ae1bb6e + 3ca3350 commit a76ae57
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion inplaceeditform/fields.py
Expand Up @@ -106,7 +106,20 @@ def get_config(self, request, **kwargs):
return config

def get_form_class(self):
return modelform_factory(self.model)

kwargs = {}

fields = getattr(self.model, 'INPLACEEDIT_FIELDS', None)

if fields:
kwargs['fields'] = fields

exclude = getattr(self.model, 'INPLACEEDIT_EXCLUDE', None)

if exclude:
kwargs['exclude'] = exclude

return modelform_factory(self.model, **kwargs)

def get_form(self):
form_class = self.get_form_class()
Expand Down

0 comments on commit a76ae57

Please sign in to comment.