P5-802 add pagination
This commit is contained in:
@@ -23,15 +23,12 @@ class Category(db.Model):
|
||||
path = slugify(path)
|
||||
return path
|
||||
|
||||
def to_json(self, nested=False):
|
||||
j = {
|
||||
def to_json(self):
|
||||
return {
|
||||
'id': self.id,
|
||||
'name': self.name
|
||||
'name': self.name,
|
||||
'texts': [t.to_json() for t in self.texts]
|
||||
}
|
||||
if nested:
|
||||
j['texts'] = [t.to_json() for t in self.texts]
|
||||
|
||||
return j
|
||||
|
||||
|
||||
class CategoryTexts(db.Model):
|
||||
|
||||
Reference in New Issue
Block a user