diff --git a/README.rst b/README.rst index 1389206..c3aac5b 100644 --- a/README.rst +++ b/README.rst @@ -216,10 +216,8 @@ We now need an action to store the data of the new person and extend the code in def first_widget(): @decore.action(title='Save Person', icon='mdi-content-save', type='submit') def first_action(self, data): - item = First_model() - item.title = data['firstname'] + ' ' + data['lastname'] - item.firstname = data['firstname'] - item.lastname = data['lastname'] + item = First_model(data['item']) + item.title = item.firstname + ' ' + item.lastname if item.save(): return True, item.title + ' saved successfully' else: diff --git a/README_DE.rst b/README_DE.rst index 289a63e..88cc2b1 100644 --- a/README_DE.rst +++ b/README_DE.rst @@ -216,10 +216,8 @@ Wir benötigen nun eine Action um die Daten der neuen Person zu speichern und er def first_widget(): @decore.action(title='Save Person', icon='mdi-content-save', type='submit') def first_action(self, data): - item = First_model() - item.title = data['firstname'] + ' ' + data['lastname'] - item.firstname = data['firstname'] - item.lastname = data['lastname'] + item = First_model(data['item']) + item.title = item.firstname + ' ' + item.lastname if item.save(): return True, item.title + ' saved successfully' else: diff --git a/decore_base/sample/bases/person_base.py b/decore_base/sample/bases/person_base.py index 741a9c3..3c5b32c 100644 --- a/decore_base/sample/bases/person_base.py +++ b/decore_base/sample/bases/person_base.py @@ -18,6 +18,8 @@ def per_vi1_di3(): def per_vi1_di3_wi1(): @decore.action(type='submit') def per_vi1_di3_wi1_ac1(self, p_data): + t_item = Model(p_data['item']) + t_item.title = t_item.first_name + ' ' + t_item.last_name return True, 'Success!' @decore.action(title='Test action', icon='mdi-test-tube', type='standard', activator='default-menu') diff --git a/docs/page/doctrees/environment.pickle b/docs/page/doctrees/environment.pickle index 77d5434..b998699 100644 Binary files a/docs/page/doctrees/environment.pickle and b/docs/page/doctrees/environment.pickle differ diff --git a/docs/page/doctrees/index.doctree b/docs/page/doctrees/index.doctree index ffe2404..84101a1 100644 Binary files a/docs/page/doctrees/index.doctree and b/docs/page/doctrees/index.doctree differ diff --git a/docs/page/html/index.html b/docs/page/html/index.html index 3bf10a2..0849276 100644 --- a/docs/page/html/index.html +++ b/docs/page/html/index.html @@ -438,10 +438,8 @@