Added function for extract post in a form dict
This commit is contained in:
parent
6361386f40
commit
95ebe395b8
2 changed files with 12 additions and 1 deletions
|
|
@ -179,6 +179,17 @@ def show_form(post, arr_form, t, yes_error=True, pass_values=True, modelform_tpl
|
|||
|
||||
return t.load_template(modelform_tpl, forms=arr_form)
|
||||
|
||||
def extract_post(post, fields):
|
||||
|
||||
"""Helper function for create a simple array from other using fields list for filter
|
||||
|
||||
Args:
|
||||
post (dict): A dict with keys and values to filter.
|
||||
fields (list): A list with keys to validate.
|
||||
"""
|
||||
|
||||
return {k:v for k,v in post.items() if k in fields}
|
||||
|
||||
#Simple Function for add repeat_password form to user model
|
||||
|
||||
def set_extra_forms_user(user_admin):
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit c261d122848940ae6c4ada22344e2caac1550670
|
||||
Subproject commit 106db6afd022ede12487c017d54b200e3a19ed8f
|
||||
Loading…
Add table
Add a link
Reference in a new issue