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() } )
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() })
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)
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(), } )
def to_json(self): json = super(FacebookAccount, self).to_json() return extend(json, {'uid': self.uid, 'name': self.name})