Skip to content

Commit

Permalink
message order by timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
atwayne committed Jan 9, 2014
1 parent 521a763 commit daf613c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@ indexes:
properties:
- name: Room.Id
- name: Timestamp

- kind: Message
properties:
- name: Room.UUID
- name: Timestamp
2 changes: 1 addition & 1 deletion src/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def Put(cls, user,content,roomId):

@classmethod
def GetByRoom(cls,roomId):
return Message.query(Message.Room.UUID == roomId).fetch()
return Message.query(Message.Room.UUID == roomId).order(Message.Timestamp).fetch()

def ToJSON(self):
return '{"id":"%s","user":{"id":"%s","name":"%s"},"time":"%s","content":"%s"}'\
Expand Down

0 comments on commit daf613c

Please sign in to comment.