Fix country set backend
This commit is contained in:
+17
-1
@@ -29,6 +29,23 @@ class Country(db.Model):
|
||||
return None
|
||||
return country_list
|
||||
|
||||
@classmethod
|
||||
def set_country_status(cls, country_uid, code, val):
|
||||
|
||||
country_data = cls.query.filter_by(uid=str(country_uid), code=str(code)).first()
|
||||
if not country_data:
|
||||
return None
|
||||
country_data.status = val
|
||||
return country_data
|
||||
|
||||
@classmethod
|
||||
def set_country_signup(cls, country_uid, code, val):
|
||||
country_data = cls.query.filter_by(uid=str(country_uid), code=str(code)).first()
|
||||
if not country_data:
|
||||
return None
|
||||
country_data.signup = val
|
||||
return country_data
|
||||
|
||||
def to_dict(self):
|
||||
return {
|
||||
"id": self.id,
|
||||
@@ -40,7 +57,6 @@ class Country(db.Model):
|
||||
"added": self.added.isoformat() if self.added else None
|
||||
}
|
||||
|
||||
|
||||
'''
|
||||
CREATE TABLE country (
|
||||
id SERIAL,
|
||||
|
||||
Reference in New Issue
Block a user