refactor-datamodel #10
1 changed files with 19 additions and 0 deletions
19
membership_data_model.py
Normal file
19
membership_data_model.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
class membership_data_model():
|
||||
def __init__(self, membership_data_dict):
|
||||
self.membership_data_dict = membership_data_dict
|
||||
self.forms = {}
|
||||
|
||||
def add_edit_fields(self, parent_form):
|
||||
self.forms['status'] = parent_form.add(npyscreen.TitleText, name="Status: ", value=mem['status'])
|
||||
self.forms['von'] = parent_form.add(npyscreen.TitleText, name="Von: ", value=mem['von'])
|
||||
self.forms['bis'] = parent_form.add(npyscreen.TitleText, name="Bis: ", value=mem['bis'])
|
||||
self.forms['mitgliedsbeitrag'] = parent_form.add(npyscreen.TitleText, name="Mitgliedsbeitrag: ",
|
||||
value=mem['mitgliedsbeitrag'])
|
||||
self.forms['schliessberechtigung'] = parent_form.add(npyscreen.TitleText, name="Schliessberechtigung: ",
|
||||
value=mem['schliessberechtigung'])
|
||||
self.forms['scan-antrag'] = parent_form.add(npyscreen.TitleText, name="URI Scan Antrag: ",
|
||||
value=mem['scan-antrag'])
|
||||
|
||||
def get_form_values_dict(self):
|
||||
membership_data_model = dict(zip(app.mem2.keys(), map(lambda f: f.value, app.mem2.values())))
|
||||
return membership_data_model
|
Loading…
Reference in a new issue