Changes between Initial Version and Version 1 of Ticket #34013, comment 3


Ignore:
Timestamp:
Sep 16, 2022, 3:26:05 PM (2 years ago)
Author:
Aman Pandey

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #34013, comment 3

    initial v1  
    11"It seems there is a lack of support JSONField in order_by queryset."
    22this is not true as JSONField based example queryset is working fine with order_by method
    3 eg:
    4 """"
    5 class Dog(models.Model):
    6     name = models.CharField(max_length=200)
    7     data = models.JSONField(null=True)
    83
    9     def __str__(self):
    10         return self.name
    11 """"
    124
    13 >>> dogs = Dog.objects.all().order_by("data")
    14 >>> dogs
    15 <QuerySet [<Dog: stella>, <Dog: tuffy>, <Dog: shifu>, <Dog: milo>]>
    16 
    17 this is working ..
    18 can someone please tell me about this model attribute how does this assigned to the object
    19 or wheather i should start with annotate class?
Back to Top