Moving stuff around to make it more easy to manage
This commit is contained in:
71
app/methods/account_cfg_methods.py
Normal file
71
app/methods/account_cfg_methods.py
Normal file
@@ -0,0 +1,71 @@
|
||||
from __future__ import annotations
|
||||
import datetime
|
||||
|
||||
from typing import Dict, List, Optional, Set, Union
|
||||
from pydantic import BaseModel, EmailStr, Field, PrivateAttr, ValidationError, validator
|
||||
|
||||
from app.db_sql import redis_lookup_id_random, sql_select
|
||||
from app.lib_general import log, logging
|
||||
|
||||
from app.methods.event_methods import load_event_obj
|
||||
|
||||
from app.models.account_cfg_models import Account_Cfg_Base
|
||||
# from app.models.membership_cfg_models import Membership_Cfg_Base
|
||||
|
||||
|
||||
# ### BEGIN ### API Account Methods ### load_account_cfg_obj() ###
|
||||
def load_account_cfg_obj(account_id:int|str) -> Account_Cfg_Base|bool:
|
||||
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
|
||||
if account_id := redis_lookup_id_random(record_id_random=account_id, table_name='account'): pass
|
||||
else: return False
|
||||
|
||||
if account_cfg_rec := sql_select(table_name='v_account_cfg', field_name='account_id', field_value=account_id):
|
||||
log.debug(account_cfg_rec)
|
||||
|
||||
try:
|
||||
account_cfg_obj = Account_Cfg_Base(**account_cfg_rec)
|
||||
log.debug(account_cfg_obj)
|
||||
except ValidationError as e:
|
||||
log.error(e.json())
|
||||
|
||||
return account_cfg_obj
|
||||
else: return False
|
||||
# ### END ### API Account Methods ### load_account_cfg_obj() ###
|
||||
|
||||
|
||||
# ### BEGIN ### API Account Methods ### load_account_cfg_obj() ###
|
||||
# def load_account_cfg_obj(account_id:int|str, inc_event_cfg:bool=False, inc_fundraising_cfg:bool=False, inc_membership_cfg:bool=False):
|
||||
# log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
# log.debug(locals())
|
||||
|
||||
# if account_id := redis_lookup_id_random(record_id_random=account_id, table_name='account'): pass
|
||||
# else: return False
|
||||
|
||||
# if account_cfg_rec := sql_select(table_name='v_account_cfg', field_name='account_id', field_value=account_id):
|
||||
# log.debug(account_cfg_rec)
|
||||
|
||||
# try:
|
||||
# account_cfg_obj = Account_Cfg_Base(**account_cfg_rec)
|
||||
# log.debug(account_cfg_obj)
|
||||
# except ValidationError as e:
|
||||
# log.error(e.json())
|
||||
|
||||
# return account_cfg_obj
|
||||
# else: return False
|
||||
|
||||
# if inc_membership_cfg:
|
||||
# if membership_cfg_rec := sql_select(table_name='v_membership_cfg', field_name='account_id', field_value=account_id):
|
||||
# #log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
# log.debug(membership_cfg_rec)
|
||||
|
||||
# #account_rec['membership_cfg'] = membership_cfg_rec
|
||||
# try:
|
||||
# membership_cfg_obj = Membership_Cfg_Base(**membership_cfg_rec)
|
||||
# log.debug(membership_cfg_obj)
|
||||
# except ValidationError as e:
|
||||
# log.error(e.json())
|
||||
|
||||
# return membership_cfg_obj
|
||||
# ### END ### API Account Methods ### load_account_cfg_obj() ###
|
||||
@@ -7,11 +7,12 @@ from pydantic import BaseModel, EmailStr, Field, PrivateAttr, ValidationError, v
|
||||
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.event_methods import load_event_obj
|
||||
|
||||
from app.models.account_models import Account_Base
|
||||
from app.models.account_cfg_models import Account_Cfg_Base
|
||||
from app.models.membership_models import Membership_Cfg_Base
|
||||
# from app.models.membership_cfg_models import Membership_Cfg_Base
|
||||
|
||||
|
||||
# ### BEGIN ### API Account Methods ### load_account_obj() ###
|
||||
@@ -19,22 +20,22 @@ def load_account_obj(
|
||||
account_id: int|str,
|
||||
enabled: str = 'enabled', # enabled, disabled, all
|
||||
limit: int = 1000,
|
||||
inc_account_cfg: bool = False,
|
||||
inc_account_cfg: bool = False, # Priority l1
|
||||
inc_address: bool = False, # Under contact
|
||||
inc_address_list: bool = False,
|
||||
inc_address_list: bool = False, # Priority l3
|
||||
inc_archive: bool = False,
|
||||
inc_archive_list: bool = False,
|
||||
inc_archive_list: bool = False, # Priority l1
|
||||
inc_contact: bool = False,
|
||||
inc_contact_list: bool = False,
|
||||
inc_contact_list: bool = False, # Priority l3
|
||||
inc_event: bool = False,
|
||||
inc_event_list: bool = False,
|
||||
inc_event_abstract: bool = False,
|
||||
inc_event_abstract_list: bool = False,
|
||||
inc_event_badge: bool = False,
|
||||
inc_event_badge_list: bool = False,
|
||||
inc_event_list: bool = False, # Priority l1
|
||||
# inc_event_abstract: bool = False,
|
||||
# inc_event_abstract_list: bool = False,
|
||||
# inc_event_badge: bool = False,
|
||||
# inc_event_badge_list: bool = False,
|
||||
inc_event_cfg: bool = False,
|
||||
inc_event_device: bool = False,
|
||||
inc_event_device_list: bool = False,
|
||||
# inc_event_device: bool = False,
|
||||
# inc_event_device_list: bool = False,
|
||||
inc_event_exhibit: bool = False,
|
||||
inc_event_exhibit_list: bool = False,
|
||||
inc_event_file: bool = False,
|
||||
@@ -53,29 +54,32 @@ def load_account_obj(
|
||||
inc_event_registration_list: bool = False,
|
||||
inc_event_session: bool = False,
|
||||
inc_event_session_list: bool = False,
|
||||
inc_event_track: bool = False, # For event_session child object
|
||||
# inc_event_track: bool = False, # For event_session child object
|
||||
inc_event_track_list: bool = False,
|
||||
inc_fundraising_cfg: bool = False,
|
||||
inc_hosted_file_list: bool = False,
|
||||
inc_journal_list: bool = False,
|
||||
inc_membership: bool = False,
|
||||
inc_journal_list: bool = False, # Priority l3
|
||||
# inc_membership: bool = False,
|
||||
inc_membership_cfg: bool = False,
|
||||
inc_membership_list: bool = False,
|
||||
inc_order: bool = False,
|
||||
inc_order_list: bool = False,
|
||||
inc_order_list: bool = False, # Priority l2
|
||||
inc_order_cart: bool = False,
|
||||
inc_order_cart_list: bool = False,
|
||||
inc_organization: bool = False,
|
||||
inc_organization_list: bool = False,
|
||||
inc_organization_list: bool = False, # Priority l3
|
||||
# inc_page: bool = False,
|
||||
inc_page_list: bool = False, # Priority l3
|
||||
inc_person: bool = False,
|
||||
inc_person_list: bool = False,
|
||||
inc_person_list: bool = False, # Priority l2
|
||||
inc_post: bool = False,
|
||||
inc_post_list: bool = False,
|
||||
inc_post_list: bool = False, # Priority l1
|
||||
inc_product: bool = False,
|
||||
inc_product_list: bool = False,
|
||||
inc_site: bool = False,
|
||||
inc_site_list: bool = False,
|
||||
inc_product_list: bool = False, # Priority l3
|
||||
# inc_site: bool = False,
|
||||
inc_site_list: bool = False, # Priority l3
|
||||
inc_user: bool = False,
|
||||
inc_user_list: bool = False,
|
||||
inc_user_list: bool = False, # Priority l2
|
||||
) -> Account_Base|bool:
|
||||
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
@@ -95,6 +99,14 @@ def load_account_obj(
|
||||
except ValidationError as e:
|
||||
log.error(e.json())
|
||||
|
||||
if inc_account_cfg:
|
||||
organization_id = account_rec.get('organization_id', None)
|
||||
if account_cfg_obj_result := load_account_cfg_obj(account_id=account_id):
|
||||
account_cfg_obj = account_cfg_obj_result
|
||||
account_cfg_dict = account_cfg_obj.dict(by_alias=True, exclude_unset=True)
|
||||
account_obj.account_cfg = account_cfg_dict
|
||||
else: account_obj.account_cfg = None
|
||||
|
||||
# if inc_contact:
|
||||
# contact_id = account_rec.get('contact_id', None)
|
||||
# if contact_obj_result := load_contact_obj(contact_id=contact_id):
|
||||
@@ -165,13 +177,13 @@ def load_account_obj(
|
||||
if event_obj := load_event_obj(
|
||||
event_id=event_id,
|
||||
enabled=enabled,
|
||||
inc_location_address=inc_address,
|
||||
inc_contact_1=inc_contact,
|
||||
inc_contact_2=inc_contact,
|
||||
inc_contact_3=inc_contact,
|
||||
inc_event_abstract_list=inc_event_abstract_list,
|
||||
inc_event_badge_list=inc_event_badge_list,
|
||||
inc_event_device_list=inc_event_device_list,
|
||||
# inc_location_address=inc_address,
|
||||
# inc_contact_1=inc_contact,
|
||||
# inc_contact_2=inc_contact,
|
||||
# inc_contact_3=inc_contact,
|
||||
# inc_event_abstract_list=inc_event_abstract_list,
|
||||
# inc_event_badge_list=inc_event_badge_list,
|
||||
# inc_event_device_list=inc_event_device_list,
|
||||
inc_event_exhibit_list=inc_event_exhibit_list,
|
||||
inc_event_file_list=inc_event_file_list,
|
||||
inc_event_location_list=inc_event_location_list,
|
||||
@@ -181,8 +193,8 @@ def load_account_obj(
|
||||
inc_event_registration_list=inc_event_registration_list,
|
||||
inc_event_session_list=inc_event_session_list,
|
||||
inc_event_track_list=inc_event_track_list,
|
||||
inc_person=inc_person,
|
||||
inc_user=inc_user
|
||||
# inc_person=inc_person,
|
||||
# inc_user=inc_user
|
||||
):
|
||||
data = event_obj.dict(by_alias=True, exclude_unset=True)
|
||||
event_obj_li.append(data)
|
||||
@@ -196,27 +208,3 @@ def load_account_obj(
|
||||
|
||||
return account_obj
|
||||
# ### END ### API Account Methods ### load_account_obj() ###
|
||||
|
||||
|
||||
# ### BEGIN ### API Account Methods ### load_account_cfg_obj() ###
|
||||
def load_account_cfg_obj(account_id:int|str, inc_event_cfg:bool=False, inc_fundraising_cfg:bool=False, inc_membership_cfg:bool=False):
|
||||
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
|
||||
if account_id := redis_lookup_id_random(record_id_random=account_id, table_name='account'): pass
|
||||
else: return False
|
||||
|
||||
if inc_membership_cfg:
|
||||
if membership_cfg_rec := sql_select(table_name='v_membership_cfg', field_name='account_id', field_value=account_id):
|
||||
#log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(membership_cfg_rec)
|
||||
|
||||
#account_rec['membership_cfg'] = membership_cfg_rec
|
||||
try:
|
||||
membership_cfg_obj = Membership_Cfg_Base(**membership_cfg_rec)
|
||||
log.debug(membership_cfg_obj)
|
||||
except ValidationError as e:
|
||||
log.error(e.json())
|
||||
|
||||
return membership_cfg_obj
|
||||
# ### END ### API Account Methods ### load_account_cfg_obj() ###
|
||||
|
||||
@@ -13,6 +13,7 @@ from app.models.account_cfg_models import Account_Cfg_Base
|
||||
# from app.models.contact_models import Contact_Base
|
||||
# from app.models.event_models import Event_Base
|
||||
from app.models.fundraising_cfg_models import Fundraising_Cfg_Base
|
||||
from app.models.membership_models import Membership_Cfg_Base
|
||||
# from app.models.person_models import Person_Base
|
||||
# from app.models.user_models import User_Base
|
||||
|
||||
@@ -44,21 +45,23 @@ class Account_Base(BaseModel):
|
||||
updated_on: Optional[datetime.datetime] = None
|
||||
|
||||
# Including other related objects
|
||||
account_cfg: Optional[Account_Cfg_Base]
|
||||
address_list: Optional[list] # Address_Base()
|
||||
archive_list: Optional[list] # Archive_Base()
|
||||
contact_list: Optional[list] # Contact_Base()
|
||||
event_list: Optional[list] # Event_Base()
|
||||
fundraising_cfg: Optional[Fundraising_Cfg_Base]
|
||||
journal_list: Optional[list] # Journal_Base()
|
||||
order_list: Optional[list] # Order_Base()
|
||||
organization_list: Optional[list] # Organization_Base()
|
||||
page_list: Optional[list] # Page_Base()
|
||||
person_list: Optional[list] # Person_Base()
|
||||
post_list: Optional[list] # Post_Base()
|
||||
product_list: Optional[list] # Product_Base()
|
||||
site_list: Optional[list] # Site_Base()
|
||||
user_list: Optional[list] # User_Base()
|
||||
account_cfg: Optional[Account_Cfg_Base] # Priority l1
|
||||
address_list: Optional[list] # Address_Base() # Priority l3
|
||||
archive_list: Optional[list] # Archive_Base() # Priority l1
|
||||
contact_list: Optional[list] # Contact_Base() # Priority l3
|
||||
event_list: Optional[list] # Event_Base() # Priority l1
|
||||
fundraising_cfg: Optional[Fundraising_Cfg_Base] # Priority l2
|
||||
hosted_file_list: Optional[list] # Hosted_File_Base() # Priority l2
|
||||
journal_list: Optional[list] # Journal_Base() # Priority l3
|
||||
membership_cfg: Optional[Membership_Cfg_Base] # Priority l2
|
||||
order_list: Optional[list] # Order_Base() # Priority l2
|
||||
organization_list: Optional[list] # Organization_Base() # Priority l3
|
||||
page_list: Optional[list] # Page_Base() # Priority l3
|
||||
person_list: Optional[list] # Person_Base() # Priority l2
|
||||
post_list: Optional[list] # Post_Base() # Priority l1
|
||||
product_list: Optional[list] # Product_Base() # Priority l3
|
||||
site_list: Optional[list] # Site_Base() # Priority l3
|
||||
user_list: Optional[list] # User_Base() # Priority l2
|
||||
|
||||
_processed_at: datetime.datetime = PrivateAttr(default_factory=datetime.datetime.now)
|
||||
|
||||
|
||||
44
app/models/membership_cfg_models.py
Normal file
44
app/models/membership_cfg_models.py
Normal file
@@ -0,0 +1,44 @@
|
||||
from __future__ import annotations
|
||||
import datetime, hashlib, logging, os, pytz, redis, secrets
|
||||
|
||||
from typing import Dict, List, Optional, Set, Union
|
||||
from pydantic import BaseModel, EmailStr, Field, Json, PrivateAttr, ValidationError, validator
|
||||
|
||||
from app.db_sql import redis_lookup_id_random
|
||||
from app.lib_general import log, logging
|
||||
|
||||
from .common_field_schema import base_fields, default_num_bytes
|
||||
|
||||
|
||||
class Membership_Cfg_Base(BaseModel):
|
||||
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
|
||||
account_name: Optional[str]
|
||||
|
||||
cycle_type: Optional[str]
|
||||
membership_length: Optional[int] = Field(0, ge=0, lt=150)
|
||||
prorate: Optional[bool] = False
|
||||
calendar_year_start_buffer_days: Optional[int] = Field(0, ge=0, lt=150)
|
||||
calendar_year_start_buffer_on: Optional[datetime.datetime] = None
|
||||
calendar_year_start_on: Optional[datetime.datetime] = None
|
||||
calendar_year_end_on: Optional[datetime.datetime] = None
|
||||
calendar_year_end_buffer_days: Optional[int] = Field(0, ge=0, lt=150)
|
||||
calendar_year_end_buffer_on: Optional[datetime.datetime] = None
|
||||
enable_privacy_view: Optional[bool] = False
|
||||
|
||||
renew_warning_hours: Optional[int]
|
||||
|
||||
accept_message: Optional[str]
|
||||
reject_message: Optional[str]
|
||||
renew_message: Optional[str]
|
||||
|
||||
#extended_membership_profile: Optional[str] # list of dicts outlining extended (custom) membership profile fields for client
|
||||
extended_membership_profile: Optional[Json] = '[]' # list of dicts outlining extended (custom) membership profile fields for client
|
||||
|
||||
default_no_reply_email: Optional[str]
|
||||
default_no_reply_name: Optional[str]
|
||||
confirm_email: Optional[str]
|
||||
confirm_name: Optional[str]
|
||||
|
||||
Membership_Cfg_Base.update_forward_refs()
|
||||
@@ -10,45 +10,12 @@ from app.lib_general import log, logging
|
||||
from .common_field_schema import base_fields, default_num_bytes
|
||||
from .address_models import Address_Base
|
||||
from .contact_models import Contact_Base
|
||||
from .membership_cfg_models import Membership_Cfg_Base
|
||||
from .organization_models import Organization_Base
|
||||
from .person_models import Person_Base
|
||||
from .user_models import User_Base
|
||||
|
||||
|
||||
class Membership_Cfg_Base(BaseModel):
|
||||
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
|
||||
account_name: Optional[str]
|
||||
|
||||
cycle_type: Optional[str]
|
||||
membership_length: Optional[int] = Field(0, ge=0, lt=150)
|
||||
prorate: Optional[bool] = False
|
||||
calendar_year_start_buffer_days: Optional[int] = Field(0, ge=0, lt=150)
|
||||
calendar_year_start_buffer_on: Optional[datetime.datetime] = None
|
||||
calendar_year_start_on: Optional[datetime.datetime] = None
|
||||
calendar_year_end_on: Optional[datetime.datetime] = None
|
||||
calendar_year_end_buffer_days: Optional[int] = Field(0, ge=0, lt=150)
|
||||
calendar_year_end_buffer_on: Optional[datetime.datetime] = None
|
||||
enable_privacy_view: Optional[bool] = False
|
||||
|
||||
renew_warning_hours: Optional[int]
|
||||
|
||||
accept_message: Optional[str]
|
||||
reject_message: Optional[str]
|
||||
renew_message: Optional[str]
|
||||
|
||||
#extended_membership_profile: Optional[str] # list of dicts outlining extended (custom) membership profile fields for client
|
||||
extended_membership_profile: Optional[Json] = '[]' # list of dicts outlining extended (custom) membership profile fields for client
|
||||
|
||||
default_no_reply_email: Optional[str]
|
||||
default_no_reply_name: Optional[str]
|
||||
confirm_email: Optional[str]
|
||||
confirm_name: Optional[str]
|
||||
|
||||
Membership_Cfg_Base.update_forward_refs()
|
||||
|
||||
|
||||
class Membership_Profile_Base(BaseModel):
|
||||
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
|
||||
@@ -97,60 +97,61 @@ async def get_account_obj_new(
|
||||
account_id: str = Query(..., min_length=1, max_length=22),
|
||||
enabled: str = 'enabled', # For now this covers any included objects or object lists
|
||||
limit: int = 500, # For now this covers any included objects or object lists
|
||||
inc_account_cfg: bool = False,
|
||||
inc_account_cfg: bool = False, # Priority l1
|
||||
inc_address: bool = False, # Under contact
|
||||
inc_address_list: bool = False,
|
||||
inc_archive: bool = False,
|
||||
inc_archive_list: bool = False,
|
||||
inc_archive_list: bool = False, # Priority l1
|
||||
inc_contact: bool = False,
|
||||
inc_contact_list: bool = False,
|
||||
inc_event: bool = False,
|
||||
inc_event_list: bool = False,
|
||||
inc_event_abstract: bool = False,
|
||||
inc_event_abstract_list: bool = False,
|
||||
inc_event_badge: bool = False,
|
||||
inc_event_badge_list: bool = False,
|
||||
inc_event_list: bool = False, # Priority l1
|
||||
# inc_event_abstract: bool = False,
|
||||
# inc_event_abstract_list: bool = False,
|
||||
# inc_event_badge: bool = False,
|
||||
# inc_event_badge_list: bool = False,
|
||||
inc_event_cfg: bool = False,
|
||||
inc_event_device: bool = False,
|
||||
inc_event_device_list: bool = False,
|
||||
inc_event_exhibit: bool = False,
|
||||
# inc_event_device: bool = False,
|
||||
# inc_event_device_list: bool = False,
|
||||
# inc_event_exhibit: bool = False,
|
||||
inc_event_exhibit_list: bool = False,
|
||||
inc_event_file: bool = False,
|
||||
# inc_event_file: bool = False,
|
||||
inc_event_file_list: bool = False,
|
||||
inc_event_location: bool = False, # For event_session child object
|
||||
# inc_event_location: bool = False, # For event_session child object
|
||||
inc_event_location_list: bool = False,
|
||||
inc_event_person: bool = False,
|
||||
# inc_event_person: bool = False,
|
||||
inc_event_person_list: bool = False,
|
||||
inc_event_presentation: bool = False,
|
||||
# inc_event_presentation: bool = False,
|
||||
inc_event_presentation_list: bool = False,
|
||||
inc_event_presenter_cat: bool = False, # For event_session child object
|
||||
inc_event_presenter: bool = False,
|
||||
# inc_event_presenter_cat: bool = False, # For event_session child object
|
||||
# inc_event_presenter: bool = False,
|
||||
inc_event_presenter_list: bool = False,
|
||||
inc_event_registration: bool = False,
|
||||
# inc_event_registration: bool = False,
|
||||
inc_event_registration_cfg: bool = False,
|
||||
inc_event_registration_list: bool = False,
|
||||
inc_event_session: bool = False,
|
||||
# inc_event_session: bool = False,
|
||||
inc_event_session_list: bool = False,
|
||||
inc_event_track: bool = False, # For event_session child object
|
||||
# inc_event_track: bool = False, # For event_session child object
|
||||
inc_event_track_list: bool = False,
|
||||
inc_fundraising_cfg: bool = False,
|
||||
inc_hosted_file_list: bool = False,
|
||||
inc_journal_list: bool = False,
|
||||
inc_membership: bool = False,
|
||||
# inc_membership: bool = False,
|
||||
inc_membership_cfg: bool = False,
|
||||
inc_membership_list: bool = False,
|
||||
inc_order: bool = False,
|
||||
# inc_order: bool = False,
|
||||
inc_order_list: bool = False,
|
||||
inc_order_cart: bool = False,
|
||||
# inc_order_cart: bool = False,
|
||||
inc_order_cart_list: bool = False,
|
||||
inc_organization: bool = False,
|
||||
inc_organization_list: bool = False,
|
||||
inc_person: bool = False,
|
||||
inc_person_list: bool = False,
|
||||
inc_post: bool = False,
|
||||
inc_post_list: bool = False,
|
||||
inc_product: bool = False,
|
||||
# inc_post: bool = False,
|
||||
inc_post_list: bool = False, # Priority l1
|
||||
# inc_product: bool = False,
|
||||
inc_product_list: bool = False,
|
||||
inc_site: bool = False,
|
||||
# inc_site: bool = False,
|
||||
inc_site_list: bool = False,
|
||||
inc_user: bool = False,
|
||||
inc_user_list: bool = False,
|
||||
@@ -177,47 +178,51 @@ async def get_account_obj_new(
|
||||
inc_contact_list=inc_contact_list,
|
||||
inc_event=inc_event,
|
||||
inc_event_list=inc_event_list,
|
||||
inc_event_abstract_list=inc_event_abstract_list,
|
||||
inc_event_badge_list=inc_event_badge_list,
|
||||
inc_event_device_list=inc_event_device_list,
|
||||
# inc_event_abstract_list=inc_event_abstract_list,
|
||||
# inc_event_badge_list=inc_event_badge_list,
|
||||
# inc_event_device_list=inc_event_device_list,
|
||||
inc_event_file_list=inc_event_file_list,
|
||||
inc_event_location=inc_event_location,
|
||||
inc_event_person=inc_event_person,
|
||||
# inc_event_location=inc_event_location,
|
||||
# inc_event_person=inc_event_person,
|
||||
inc_event_person_list=inc_event_person_list,
|
||||
inc_event_presentation_list=inc_event_presentation_list,
|
||||
inc_event_presenter_cat=inc_event_presenter_cat,
|
||||
# inc_event_presenter_cat=inc_event_presenter_cat,
|
||||
inc_event_presenter_list=inc_event_presenter_list,
|
||||
inc_event_registration_list=inc_event_registration_list,
|
||||
inc_event_track=inc_event_track,
|
||||
inc_event_session_list=inc_event_session_list,
|
||||
# inc_event_track=inc_event_track,
|
||||
inc_event_track_list=inc_event_track_list,
|
||||
inc_fundraising_cfg=inc_fundraising_cfg,
|
||||
inc_hosted_file_list=inc_hosted_file_list,
|
||||
inc_journal_list=inc_journal_list,
|
||||
inc_membership=inc_membership,
|
||||
# inc_membership=inc_membership,
|
||||
inc_membership_cfg=inc_membership_cfg,
|
||||
inc_membership_list=inc_membership_list,
|
||||
inc_order=inc_order,
|
||||
# inc_order=inc_order,
|
||||
inc_order_list=inc_order_list,
|
||||
inc_order_cart=inc_order_cart,
|
||||
# inc_order_cart=inc_order_cart,
|
||||
inc_order_cart_list=inc_order_cart_list,
|
||||
inc_organization=inc_organization,
|
||||
inc_organization_list=inc_organization_list,
|
||||
inc_person=inc_person,
|
||||
inc_person_list=inc_person_list,
|
||||
inc_post=inc_post,
|
||||
# inc_post=inc_post,
|
||||
inc_post_list=inc_post_list,
|
||||
inc_product=inc_product,
|
||||
# inc_product=inc_product,
|
||||
inc_product_list=inc_product_list,
|
||||
inc_site=inc_site,
|
||||
# inc_site=inc_site,
|
||||
inc_site_list=inc_site_list,
|
||||
inc_user=inc_user,
|
||||
inc_user_list=inc_user_list,
|
||||
):
|
||||
account_dict = account_obj.dict(by_alias=by_alias, exclude_unset=exclude_unset)
|
||||
pass
|
||||
if isinstance(account_obj, Account_Base):
|
||||
response_data = account_obj.dict(by_alias=by_alias, exclude_unset=exclude_unset) # pylint: disable=no-member
|
||||
else:
|
||||
response_data = account_obj
|
||||
else:
|
||||
return mk_resp(data=False, status_code=400) # Bad Request
|
||||
|
||||
return mk_resp(data=account_dict)
|
||||
return mk_resp(data=response_data)
|
||||
#return mk_resp(data=account_obj)
|
||||
# ### END ### API Account ### get_account_obj() ###
|
||||
|
||||
|
||||
@@ -237,10 +237,11 @@ async def get_event_obj_li(
|
||||
inc_event_cfg=inc_event_cfg,
|
||||
inc_event_registration_cfg=inc_event_registration_cfg,
|
||||
inc_poc_event_person=inc_poc_event_person,
|
||||
inc_poc_person=inc_poc_person,
|
||||
# inc_poc_person=inc_poc_person,
|
||||
inc_user=inc_user,
|
||||
):
|
||||
data = event_obj.dict(by_alias=by_alias, exclude_unset=exclude_unset)
|
||||
|
||||
data = event_obj.dict(by_alias=by_alias, exclude_unset=exclude_unset) # pylint: disable=no-member
|
||||
event_obj_li.append(data)
|
||||
return mk_resp(data=event_obj_li)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user