Re: Design Q: Foreign keys from object.values()

2007-01-10 Thread George Davis
Great -- thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECT

Re: Design Q: Foreign keys from object.values()

2007-01-10 Thread Ivan Sagalaev
[EMAIL PROTECTED] wrote: > Thanks; this works for me -- though I have to do > > Author.objects.filter(story__id__isnull=False).distinct() > > Or it repeats each author for each of his stories. > > This still confuses me, because there is no "story" field in the Author > model to specify ho

Re: Design Q: Foreign keys from object.values()

2007-01-10 Thread [EMAIL PROTECTED]
Thanks; this works for me -- though I have to do Author.objects.filter(story__id__isnull=False).distinct() Or it repeats each author for each of his stories. This still confuses me, because there is no "story" field in the Author model to specify how to do the join (Author:Story is One:Man

Re: Design Q: Foreign keys from object.values()

2007-01-10 Thread Kai Kuehne
Hi George, On 1/10/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > class Author (models.Model) : > name = CharField(maxlength=100) > class Story (models.Model) : > author = ForeignKey(Author) What about a relation, hm? :) Kai --~--~-~--~~~---~--~~ You re

Re: Design Q: Foreign keys from object.values()

2007-01-10 Thread Ivan Sagalaev
[EMAIL PROTECTED] wrote: > Hi guys, > > I'm trying to get a better grip on Django design philosophy, and I'm a > little confused as to why calls to a manager's " values() " function > returns foreign keys as the value of their primary key rather than as > django objects. For example: > > class

Design Q: Foreign keys from object.values()

2007-01-10 Thread [EMAIL PROTECTED]
Hi guys, I'm trying to get a better grip on Django design philosophy, and I'm a little confused as to why calls to a manager's " values() " function returns foreign keys as the value of their primary key rather than as django objects. For example: class Author (models.Model) : name = CharFiel