Example #1
0
 def to_json(self):
     json = super(Message, self).to_json()
     return extend(
         json, {
             'id': self.id, 'message': self.message, 'color': self.color,
             'chat_room_id': self.chat_room_id, 'user': self.user.to_json()
         }
     )
Example #2
0
 def to_json(self):
     json = super(Message, self).to_json()
     return extend(
         json, {
             'id': self.id,
             'message': self.message,
             'color': self.color,
             'chat_room_id': self.chat_room_id,
             'user': self.user.to_json()
         })
Example #3
0
 def to_json(self):
     json = super(User, self).to_json()
     if self.facebook_account:
         facebook_account = self.facebook_account.to_json()
     else:
         facebook_account = None
     user = {
         'nickname': self.nickname, 'email': self.email,
         'facebook_account': facebook_account, 'status': self.status
     }
     return extend(json, user)
Example #4
0
 def to_json(self):
     json = super(ChatRoom, self).to_json()
     return extend(
         json, {
             'users': [
                 u.to_json() for u in\
                     self.users.order_by(users_in_chat_room.c.created)
             ],
             'creator': self.creator.to_json(),
         }
     )
Example #5
0
 def to_json(self):
     json = super(ChatRoom, self).to_json()
     return extend(
         json, {
             'users': [
                 u.to_json() for u in\
                     self.users.order_by(users_in_chat_room.c.created)
             ],
             'creator': self.creator.to_json(),
         }
     )
Example #6
0
 def to_json(self):
     json = super(User, self).to_json()
     if self.facebook_account:
         facebook_account = self.facebook_account.to_json()
     else:
         facebook_account = None
     user = {
         'nickname': self.nickname,
         'email': self.email,
         'facebook_account': facebook_account,
         'status': self.status
     }
     return extend(json, user)
Example #7
0
 def to_json(self):
     json = super(FacebookAccount, self).to_json()
     return extend(json, {'uid': self.uid, 'name': self.name})
Example #8
0
 def to_json(self):
     json = super(FacebookAccount, self).to_json()
     return extend(json, {'uid': self.uid, 'name': self.name})