I am using a nested relationship to return grouped messages and was wondering how i can order the nested messages so that they are ordered chronologically.
class MessageGroupResource(ModelResource):
messages = fields.ToManyField('lookup.api.MessageResource', 'message_set', full=True);
class Meta:
queryset = MessageGroup.objects.all();
resource_name = 'message'
authorization= UserAuthorization()
ordering = [
'sendTime',
]
class MessageResource(ModelResource):
messageGroup = fields.ForeignKey(MessageGroupResource, 'messageGroup')
class Meta:
queryset = Message.objects.all()
resource_name = 'submessage'
authorization= UserAuthorization()