Fix country set backend

This commit is contained in:
CHIEFSOFT\ameye
2025-10-07 06:13:56 -04:00
parent 18562c922e
commit d561d942dd
2 changed files with 28 additions and 5 deletions
+17 -1
View File
@@ -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,