country model
This commit is contained in:
@@ -22,6 +22,13 @@ class Country(db.Model):
|
||||
return None
|
||||
return country_list
|
||||
|
||||
@classmethod
|
||||
def get_all_countries(cls):
|
||||
country_list = cls.query.all()
|
||||
if not country_list:
|
||||
return None
|
||||
return country_list
|
||||
|
||||
def to_dict(self):
|
||||
return {
|
||||
"id": self.id,
|
||||
|
||||
@@ -30,7 +30,12 @@ class MembersProductsRefresh(db.Model):
|
||||
updated = db.Column(db.DateTime(timezone=True), server_default=func.now(), onupdate=func.now())
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def get_active_refresh_by_subscription_uid(cls, subscription_uid):
|
||||
refresh_product = cls.query.filter_by(subscription_uid=str(subscription_uid), status=0).all()
|
||||
if not refresh_product:
|
||||
return None
|
||||
return refresh_product
|
||||
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user