a = YouModelName.objects.all().values_list()
b= a.order_by('created_at')

On Wed, 18 Sep 2019, 17:44 Shakil Ahmmed, <[email protected]> wrote:

> I want to select all field in a model but Grouy By One field.. Suppose i
> have country,people , and onther field in a model i want to  group by
> country but select all field
>
> On Wed, Sep 18, 2019, 6:05 PM Anirudh Jain <[email protected]>
> wrote:
>
>> Example: YouModelName.objects.all().order_by('created_at')
>>
>>
>> This will sort all the objects in your model on the basis of date of
>> creation on that object.
>>
>> On Wed, 18 Sep 2019, 12:16 Shakil Ahmmed, <[email protected]> wrote:
>>
>>>
>>> How to select all field but group by one field
>>> --
>>>
>>> <https://about.me/shakilahmmed?promo=email_sig&utm_source=product&utm_medium=email_sig&utm_campaign=gmail_api&utm_content=thumb>
>>> Shakil Ahmmed
>>> about.me/shakilahmmed
>>> <https://about.me/shakilahmmed?promo=email_sig&utm_source=product&utm_medium=email_sig&utm_campaign=gmail_api&utm_content=thumb>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CA%2BEpJfzNPZ_vRqyHan92VsDY9MAjsxogKVh4FEBdwXWLd%3DHXtQ%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CA%2BEpJfzNPZ_vRqyHan92VsDY9MAjsxogKVh4FEBdwXWLd%3DHXtQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAC3mK7frp_NWYmtJ1mUjrC3vTr6nb1%3DcoHWQiD48f7jnHbFhzQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAC3mK7frp_NWYmtJ1mUjrC3vTr6nb1%3DcoHWQiD48f7jnHbFhzQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CA%2BEpJfx8i%2BYCDD16NUn1wjDW4bsdhFgySbtHYUChCR1ArbBEBQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CA%2BEpJfx8i%2BYCDD16NUn1wjDW4bsdhFgySbtHYUChCR1ArbBEBQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAC3mK7fJyqrvFZUU4xUe%2BDdCtWBqCUD%3DPvFbVNN2Pcv1iPb6Gw%40mail.gmail.com.

Reply via email to