Skip to content

Commit

Permalink
Add argumento to ControlQueryList and fix bug on ModelForm
Browse files Browse the repository at this point in the history
  • Loading branch information
UmSenhorQualquer committed Feb 14, 2019
1 parent c032171 commit 36cd766
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions pyforms_web/controls/control_querylist.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def __init__(self, *args, **kwargs):
self.export_csv_columns = kwargs.get('export_csv_columns', self.list_display)
self._columns_size = kwargs.get('columns_size', None)
self._columns_align = kwargs.get('columns_align', None)
self.item_selection_changed_event = kwargs.get('item_selection_changed_event', self.item_selection_changed_event)


self.search_field_key = None
Expand Down
5 changes: 2 additions & 3 deletions pyforms_web/widgets/django/modelform.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def __init__(self, *args, **kwargs):
self.create_model_formfields()

if self.object_pk:
self.show_edit_form()
self.show_edit_form(pk=self.object_pk)
else:
self.show_create_form()

Expand Down Expand Up @@ -463,7 +463,6 @@ def show_edit_form(self, pk=None):
except AttributeError:
continue


if callable(field) and not isinstance(field, models.Model):
pyforms_field.value = value()

Expand Down Expand Up @@ -803,7 +802,7 @@ def save_event(self, obj, new_object):
if self.POPULATE_PARENT: self.parent.populate_list()

self.cancel_btn_event()
self.parent.show_edit_form(obj)
self.parent.show_edit_form(obj.pk)
self.parent.success('The object <b>{0}</b> was saved with success!'.format(obj),'Success!')

elif obj:
Expand Down

0 comments on commit 36cd766

Please sign in to comment.