예제 #1
0
파일: models.py 프로젝트: kamiracle/LostPet
 def serialize(self):
     return {
         'id': self.id,
         'username': self.user_name,
         'email': self.email,
         'default_search_loc': db_session.scalar(self.default_search_location.wkt),
         'default_search_polygon': db_session.scalar(self.default_search_polygon.wkt)
     }
예제 #2
0
파일: models.py 프로젝트: kamiracle/LostPet
 def serialize(self):
     return {
         'id': self.id,
         'pet_name': self.name,
         'last_seen_loc': db_session.scalar(self.last_seen_loc.wkt),
         'search_polygon': db_session.scalar(self.search_polygon.wkt),
         'last_seen_date': dump_datetime(self.last_seen_date),
         'created': dump_datetime(self.created),
         'user_id': self.user_id,
         'age': self.age,
         'vet': self.vet,
         'fav_food': self.fav_food,
         'known_words': self.known_words,
         'house_broken': self.house_broken,
         'approach': self.approach,
         'personality': self.personality,
         'last_seen_city': self.last_seen_city,
         'last_seen_state': self.last_seen_date,
         # This is an example how to deal with Many2Many relations
         #'many2many': self.serialize_many2many
     }