create default avatar, admin, and deleted user on first run
This commit is contained in:
10
app/db.py
10
app/db.py
@ -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"]})
|
||||
|
Reference in New Issue
Block a user