Skip to content

Commit

Permalink
[doc] work on doc and page
Browse files Browse the repository at this point in the history
  • Loading branch information
KemoPanzah committed Jun 18, 2023
1 parent 95383e8 commit 1884853
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 12 deletions.
6 changes: 2 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 2 additions & 4 deletions README_DE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions decore_base/sample/bases/person_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
Binary file modified docs/page/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/page/doctrees/index.doctree
Binary file not shown.
6 changes: 2 additions & 4 deletions docs/page/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -438,10 +438,8 @@ <h4>Action<a class="headerlink" href="#action" title="Permalink to this heading"
<span class="k">def</span> <span class="nf">first_widget</span><span class="p">():</span>
<span class="nd">@decore</span><span class="o">.</span><span class="n">action</span><span class="p">(</span><span class="n">title</span><span class="o">=</span><span class="s1">&#39;Save Person&#39;</span><span class="p">,</span> <span class="n">icon</span><span class="o">=</span><span class="s1">&#39;mdi-content-save&#39;</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="s1">&#39;submit&#39;</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">first_action</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">):</span>
<span class="n">item</span> <span class="o">=</span> <span class="n">First_model</span><span class="p">()</span>
<span class="n">item</span><span class="o">.</span><span class="n">title</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="s1">&#39;firstname&#39;</span><span class="p">]</span> <span class="o">+</span> <span class="s1">&#39; &#39;</span> <span class="o">+</span> <span class="n">data</span><span class="p">[</span><span class="s1">&#39;lastname&#39;</span><span class="p">]</span>
<span class="n">item</span><span class="o">.</span><span class="n">firstname</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="s1">&#39;firstname&#39;</span><span class="p">]</span>
<span class="n">item</span><span class="o">.</span><span class="n">lastname</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="s1">&#39;lastname&#39;</span><span class="p">]</span>
<span class="n">item</span> <span class="o">=</span> <span class="n">First_model</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s1">&#39;item&#39;</span><span class="p">])</span>
<span class="n">item</span><span class="o">.</span><span class="n">title</span> <span class="o">=</span> <span class="n">item</span><span class="o">.</span><span class="n">firstname</span> <span class="o">+</span> <span class="s1">&#39; &#39;</span> <span class="o">+</span> <span class="n">item</span><span class="o">.</span><span class="n">lastname</span>
<span class="k">if</span> <span class="n">item</span><span class="o">.</span><span class="n">save</span><span class="p">():</span>
<span class="k">return</span> <span class="kc">True</span><span class="p">,</span> <span class="n">item</span><span class="o">.</span><span class="n">title</span> <span class="o">+</span> <span class="s1">&#39; saved successfully&#39;</span>
<span class="k">else</span><span class="p">:</span>
Expand Down

0 comments on commit 1884853

Please sign in to comment.