Пример #1
0
 def get(self, parents):
     childs = ChildModel.childs()
     data = []
     if childs:
         for child in childs:
             if len(child.parents) == parents:
                 data.appen(child)
         return data
     return {'message': 'There are no registered childs'}, 404
Пример #2
0
 def get(self):
     childs = ChildModel.childs()
     temp_childs = []
     if childs:
         for child in childs:
             data = {
                 'id': child.id,
                 'name': child.name,
                 'child': child.child,
                 'createdAt': str(child.createdAt),
                 'updatedAt': str(child.updatedAt)
             }
             temp_childs.append(data)
         return temp_childs
     return {'message': 'There are no registered childs'}, 404