Re: group by and retrieve to template date from foreinKey

2011-07-15 Thread nicolas HERSOG
Oh sorry, I knew that my sql query was naive, but my question was really about how to use group by and retrieve data throug my template :/ I'm really sorry for waste your time with stupid sql. Nevertheless a great thank you for your help. I'm going to do like you say and in few times, try to chan

Re: group by and retrieve to template date from foreinKey

2011-07-15 Thread bruno desthuilliers
On Jul 15, 2:53 pm, nicolas HERSOG wrote: > Of course, and thanks for your help :) > > This is the rows of my first table Video : > id | name | category_id | date > 1 | vids1 | 1 | dd-jj- > 2 | vids2 | 1 | dd-jj- > 3 | vids3 | 1 | dd-jj- > 4 | vids4 | 2 | dd-jj- > 5 | vids5 | 2 | d

Re: group by and retrieve to template date from foreinKey

2011-07-15 Thread nicolas HERSOG
Of course, and thanks for your help :) This is the rows of my first table Video : id | name | category_id | date 1 | vids1 | 1 | dd-jj- 2 | vids2 | 1 | dd-jj- 3 | vids3 | 1 | dd-jj- 4 | vids4 | 2 | dd-jj- 5 | vids5 | 2 | dd-jj- 6 | vids6 | 3 | dd-jj- and here the rows of t

Re: group by and retrieve to template date from foreinKey

2011-07-15 Thread bruno desthuilliers
On Jul 15, 10:13 am, Suprnaturall wrote: > Hi dear django users :) > > I m facing a stupid problem. > Here is my models.py : > > class Video(models.Model): >     (...) >     category = models.ForeignKey('Category') >    (...) > > class Category(models.Model): >     name = models.CharField(max_leng

Re: group by and retrieve to template date from foreinKey

2011-07-15 Thread Venkatraman S
concise reply : I would strongly suggest you to have a look at django-taggit. OTOH, use django-debug-toolbar to diagnose the sql that is being fired. -V -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django

group by and retrieve to template date from foreinKey

2011-07-15 Thread Suprnaturall
Hi dear django users :) I m facing a stupid problem. Here is my models.py : class Video(models.Model): (...) category = models.ForeignKey('Category') (...) class Category(models.Model): name = models.CharField(max_length=250) I'm trying in a tags to make a group by on the categor