Beispiel #1
0
 def serialize(self):
     """Return object data in easily serializeable format"""
     return {
         'id': self.id,
         'note': self.note,
         'percent': self.percent,
         'date_created': dump_datetime(self.date_created),
         'task_id': self.task_id,
         'owner': self.owner.full_name
     }
Beispiel #2
0
 def serialize(self):
     """Return object data in easily serializeable format"""
     return {
         'id': self.id,
         'name': self.name,
         'group1': self.group1,
         'group2': self.group2,
         't': self.t,
         'user_id': self.user_id,
         'time': dump_datetime(self.time),
     }
Beispiel #3
0
 def serialize(self):
     """Return object data in easily serializeable format"""
     return {
         'id': self.id,
         'full_name': self.full_name,
         'username': self.username,
         'email': self.email,
         'account_type': self.account_type,
         'date_created': dump_datetime(self.date_created),
         # This is an example how to deal with Many2Many relations
         # 'projects': self.serialize_projects
     }
Beispiel #4
0
 def serialize(self):
     """Return object data in easily serializeable format"""
     return {
         'id': self.id,
         'title': self.title,
         'budget': self.budget,
         'description': self.description,
         'project_id': self.project_id,
         'percent': self.percent,
         'owner_id': self.owner_id,
         'start_date': self.start_date,
         'start_date_format': dump_datetime(self.start_date),
         'deadline': self.deadline,
         'deadline_format': dump_datetime(self.deadline),
         'status': self.status,
         'statusText': self.statusText,
         'date_created': dump_datetime(self.date_created),
         # This is an example how to deal with Many2Many relations
         'owner': self.owner.serialize,
         'history': self.serialize_history
     }
Beispiel #5
0
 def serialize(self):
     """Return object data in easily serializeable format"""
     return {
         'id': self.id,
         'title': self.title,
         'description': self.description,
         'budget_limit': self.budget_limit,
         'start_date': self.start_date,
         'end_date': self.end_date,
         'status': self.status,
         'completion': self.completion,
         'date_created': dump_datetime(self.date_created),
         # This is an example how to deal with Many2Many relations
         'owner': self.serialize_owner
     }
Beispiel #6
0
 def date_created_string(self):
     return dump_datetime(self.date_created)
Beispiel #7
0
 def string_date(self, value):
     return dump_datetime(value)
Beispiel #8
0
 def deadline_string(self):
     return dump_datetime(self.deadline)