Reputation: 23
I have this view:
class IndexLatest(ListView):
context_object_name = 'latest'
model = MyModel
template_name = 'my_app/index.html'
def get_queryset(self):
return MyModel.objects.filter(user_id=self.request.user,)
How can I add the order_by
argument to the queryset? The model has a date field, and I've tried to add it after the comma but it did not work out!
Upvotes: 0
Views: 32