Working on all the routes, methods, and models.

This commit is contained in:
Scott Idem
2021-06-18 14:09:07 -04:00
parent bb2f14b67c
commit 938aabb2a8
29 changed files with 941 additions and 335 deletions

View File

@@ -42,6 +42,8 @@ def create_post_obj(post_obj_new:Post_Base):
def load_post_obj(
post_id: int|str,
limit: int = 1000,
by_alias: bool = True,
exclude_unset: bool = True,
model_as_dict: bool = False,
enabled: str = 'enabled', # enabled, disabled, all
inc_post_comment_list: bool = False,
@@ -86,33 +88,23 @@ def load_post_obj(
limit = limit,
enabled = enabled,
):
post_comment_dict_list = []
post_comment_result_list = []
for post_comment_rec in post_comment_rec_list_result:
post_comment_dict_list.append(
post_comment_result_list.append(
load_post_comment_obj(
post_comment_id = post_comment_rec.get('post_comment_id', None),
limit = limit,
by_alias = by_alias,
exclude_unset = exclude_unset,
model_as_dict = model_as_dict,
enabled = enabled,
inc_person = inc_person,
inc_user = inc_user,
)
)
post_obj.post_comment_list = post_comment_dict_list
post_obj.post_comment_list = post_comment_result_list
else: post_obj.post_comment_list = []
# if inc_post_comment_list:
# if post_comment_dict_list := load_post_comment_obj_list(
# post_id = post_id,
# limit = limit,
# model_as_dict = model_as_dict,
# enabled = enabled,
# inc_person = inc_person,
# inc_user = inc_user,
# ):
# post_obj.post_comment_list = post_comment_dict_list
# else: post_obj.post_comment_list = None
if inc_user:
user_id = post_rec.get('user_id', None)
if user_obj_result := load_user_obj(user_id=user_id):
@@ -135,6 +127,8 @@ def load_post_obj_list(
account_id: int|str|None = None,
user_id: int|str|None = None,
limit: int = 1000,
by_alias: bool = True,
exclude_unset: bool = True,
model_as_dict: bool = False,
enabled: str = 'enabled', # enabled, disabled, all
inc_post_comment_list: bool = False,