Clean up of code...
This commit is contained in:
@@ -8,7 +8,9 @@ from app.db_sql import redis_lookup_id_random, sql_select
|
||||
from app.lib_general import log, logging
|
||||
|
||||
from app.methods.account_cfg_methods import load_account_cfg_obj
|
||||
# from app.methods.address_methods import load_address_obj_list
|
||||
from app.methods.archive_methods import load_archive_obj_list
|
||||
# from app.methods.contact_methods import load_contact_obj_list
|
||||
from app.methods.event_methods import load_event_obj_list
|
||||
from app.methods.post_methods import load_post_obj_list
|
||||
|
||||
@@ -110,7 +112,7 @@ def load_account_obj(
|
||||
if inc_account_cfg:
|
||||
if account_cfg_dict := load_account_cfg_obj(
|
||||
account_id = account_id,
|
||||
model_as_dict = True,
|
||||
model_as_dict = model_as_dict,
|
||||
# inc_event_cfg = inc_event_cfg,
|
||||
inc_fundraising_cfg = inc_fundraising_cfg,
|
||||
inc_membership_cfg = inc_membership_cfg,
|
||||
@@ -118,34 +120,37 @@ def load_account_obj(
|
||||
account_obj.account_cfg = account_cfg_dict
|
||||
else: account_obj.account_cfg = None
|
||||
|
||||
if inc_address_list:
|
||||
if address_dict_list := load_address_obj_list(
|
||||
account_id = account_id,
|
||||
limit = limit,
|
||||
model_as_dict = model_as_dict,
|
||||
enabled = enabled,
|
||||
):
|
||||
account_obj.address_list = address_dict_list
|
||||
else: account_obj.address_list = []
|
||||
|
||||
if inc_archive_list:
|
||||
if archive_dict_list := load_archive_obj_list(
|
||||
account_id = account_id,
|
||||
limit = limit,
|
||||
model_as_dict = True,
|
||||
model_as_dict = model_as_dict,
|
||||
enabled = enabled,
|
||||
inc_archive_content_list = inc_archive_content_list,
|
||||
):
|
||||
account_obj.archive_list = archive_dict_list
|
||||
else: account_obj.archive_list = []
|
||||
|
||||
# if inc_contact:
|
||||
# contact_id = account_rec.get('contact_id', None)
|
||||
# if contact_obj_result := load_contact_obj(contact_id=contact_id):
|
||||
# contact_obj = contact_obj_result
|
||||
# #account_obj.contact = contact_obj.dict(by_alias=True, exclude_unset=True)
|
||||
# account_obj.contact = contact_obj
|
||||
# else: account_obj.contact = None
|
||||
|
||||
# if inc_address:
|
||||
# address_id = contact_obj.address_id
|
||||
# if address_obj_result := load_address_obj(address_id=address_id):
|
||||
# address_obj = address_obj_result
|
||||
# # account_rec['contact'].address = address_obj
|
||||
# # log.debug(account_rec)
|
||||
# #account_obj.contact.address = address_obj.dict(by_alias=True, exclude_unset=True)
|
||||
# account_obj.contact.address = address_obj
|
||||
# else: account_obj.contact.address = None
|
||||
if inc_contact_list:
|
||||
if contact_dict_list := load_contact_obj_list(
|
||||
account_id = account_id,
|
||||
limit = limit,
|
||||
model_as_dict = model_as_dict,
|
||||
enabled = enabled,
|
||||
inc_address = inc_address,
|
||||
):
|
||||
account_obj.contact_list = contact_dict_list
|
||||
else: account_obj.contact_list = []
|
||||
|
||||
# if inc_organization:
|
||||
# organization_id = account_rec.get('organization_id', None)
|
||||
@@ -161,7 +166,7 @@ def load_account_obj(
|
||||
if event_dict_list := load_event_obj_list(
|
||||
account_id = account_id,
|
||||
limit = limit,
|
||||
model_as_dict = True,
|
||||
model_as_dict = model_as_dict,
|
||||
enabled = enabled,
|
||||
# inc_location_address = inc_address,
|
||||
# inc_contact_1 = inc_contact,
|
||||
@@ -189,7 +194,7 @@ def load_account_obj(
|
||||
if post_dict_list := load_post_obj_list(
|
||||
account_id = account_id,
|
||||
limit = limit,
|
||||
model_as_dict = True,
|
||||
model_as_dict = model_as_dict,
|
||||
enabled = enabled,
|
||||
inc_post_comment_list = inc_post_comment_list,
|
||||
inc_person = inc_person,
|
||||
|
||||
Reference in New Issue
Block a user