Hi, if you're planning to group your data after it was retrieved from database, 
you could use itertools.groupby(): 
https://docs.python.org/3/library/itertools.html#itertools.groupby 
<https://docs.python.org/3/library/itertools.html#itertools.groupby>

If grouping has to take place during database query, I can't help you =/

> On 3 Nov 2016, at 13:15, Awadhesh Meshram <awadh...@mnchost.com> wrote:
> 
> How to GROUP BY using any identical field in database in Django?
> 
> -- 
> 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 django-users+unsubscr...@googlegroups.com 
> <mailto:django-users+unsubscr...@googlegroups.com>.
> To post to this group, send email to django-users@googlegroups.com 
> <mailto:django-users@googlegroups.com>.
> Visit this group at https://groups.google.com/group/django-users 
> <https://groups.google.com/group/django-users>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/65f54a2e-8b73-43c2-b46a-8671747f2611%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/65f54a2e-8b73-43c2-b46a-8671747f2611%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/C575C186-7611-41FE-B6D5-F7E20C8E9773%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to