fix actions
This commit is contained in:
@@ -43,7 +43,27 @@ class MembersActions(db.Model):
|
||||
raise ValueError(f"No Member Actions")
|
||||
return member_actions
|
||||
|
||||
@classmethod
|
||||
def get_recent_member_calendar_actions_member_id(cls, member_id, limit):
|
||||
# member_actions = cls.query.limit(4).all()
|
||||
member_actions = cls.query.filter_by(member_id=member_id).order_by(cls.id.desc()).limit(limit).all()
|
||||
|
||||
if not member_actions:
|
||||
raise ValueError(f"No Member Actions")
|
||||
return member_actions
|
||||
|
||||
# '''
|
||||
# merms_panel=# select * from members_actions limit 2;
|
||||
# id | uid | member_id | member_uid | action_label | action_name | status_description | status | adde
|
||||
# d | updated
|
||||
# ----+--------------------------------------+-----------+--------------------------------------+------------------------+----------------------+--------------------+--------+---------------
|
||||
# -------------+----------------------------
|
||||
# 1 | 91f112f3-c8ad-4533-bfa7-117f8e8781b4 | 2 | f995061e-a36c-4648-a3fc-d18e3d93e353 | Systems Status Checks | system_status_checks | processing | 0 | 2025-07-20 18:
|
||||
# 52:08.011359 | 2025-07-20 18:52:08.011359
|
||||
# 2 | 7fa90e2d-d4d2-40fd-bbad-c18be69f8967 | 1 | 2493007e-ab59-428a-8d34-ce66c8dea5ac | Systems Status Checks | system_status_checks | processing | 0 | 2025-07-20 18:
|
||||
# 52:08.093698 | 2025-07-20 18:52:08.093698
|
||||
# (2 rows)
|
||||
# '''
|
||||
def to_dict(self):
|
||||
"""
|
||||
Convert the Loan object to a dictionary format for JSON serialization.
|
||||
|
||||
@@ -47,6 +47,24 @@ class ProvisionActions(db.Model):
|
||||
return provision_action
|
||||
|
||||
|
||||
@classmethod
|
||||
def get_provision_action_calendar_member_id(cls, member_id, limit):
|
||||
provision_action = cls.query.all()
|
||||
provision_action = cls.query.filter_by(member_id=member_id).limit(limit).all()
|
||||
if not provision_action:
|
||||
return None
|
||||
return provision_action
|
||||
|
||||
# '''
|
||||
# merms_panel=# select * from provision_actions limit 2;
|
||||
# id | uid | member_id | product_uid | action | added
|
||||
# ----+--------------------------------------+-----------+--------------------------------------+-------------------------------+----------------------------
|
||||
# 1 | 8b7db9fb-1404-4505-9858-7f418a6ae416 | 1 | df5bc060-18e0-4546-ae9a-89f7436f7cff | Allocating Provisioning Ports | 2025-07-12 21:21:02.036093
|
||||
# 2 | d0e0fe16-4e0f-4cdc-856e-d8cfeb6c673f | 1 | 58645ef9-e334-45e0-8ce1-8ec637a20c50 | Allocating Provisioning Ports | 2025-07-13 15:02:04.388589
|
||||
# (2 rows)
|
||||
#
|
||||
# '''
|
||||
|
||||
def to_dict(self):
|
||||
"""
|
||||
Convert the Loan object to a dictionary format for JSON serialization.
|
||||
|
||||
Reference in New Issue
Block a user