create default avatar, admin, and deleted user on first run

This commit is contained in:
2025-06-29 19:32:09 +03:00
parent 9d20da6a16
commit b0bd27edd0
7 changed files with 88 additions and 1 deletions

View File

@ -200,6 +200,16 @@ class Model:
return None
@classmethod
def count(cls, conditions = None):
qb = db.QueryBuilder(cls.table).select("COUNT(*) AS c")
if conditions is not None:
qb.where(conditions)
result = qb.first()
return result["c"] if result else 0
def update(self, data):
qb = db.QueryBuilder(self.table)\
.where({"id": self._data["id"]})