Re: how can i get all values of a field

2014-05-23 Thread Lachlan Musicman
No, that wouldn't work because Category looks like a var on Novel, not a model in it's own right. Novels.objects.filter(category="comedy") is how to get a distinct category. To get the list of categories used, use distinct for a quick hack - something like: Novel.objects.order_by('category').dis

Re: how can i get all values of a field

2014-05-23 Thread Jonathan Querubina
Hi dota and java, If your model for the categories is Category, you would use: Category.objects.all() Sent from my iPad > On May 23, 2014, at 23:23, dotaandj...@gmail.com wrote: > > i can't find a more effective method from the documentation,but thank you all > the same > > 在 2014年5月23日星期五UT

Re: how can i get all values of a field

2014-05-23 Thread dotaandjava
i can't find a more effective method from the documentation,but thank you all the same 在 2014年5月23日星期五UTC+8下午11时12分13秒,sacrac写道: > > Hi, you read the documentation? > https://docs.djangoproject.com/en/1.6/ref/models/querysets/ > > > On Fri, May 23, 2014 at 6:36 AM, > wrote: > >> In Models i decl

Re: how can i get all values of a field

2014-05-23 Thread carlos
Hi, you read the documentation? https://docs.djangoproject.com/en/1.6/ref/models/querysets/ On Fri, May 23, 2014 at 6:36 AM, wrote: > In Models i declare Novel: name,category > table structure: > --- > id| name |category >

how can i get all values of a field

2014-05-23 Thread dotaandjava
In Models i declare Novel: name,category table structure: --- id| name |category --- now i want to get all category,but i have no idea,who can help me? my english is poor,please don't joke me -- You received th