On Wed, 2009-05-06 at 13:14 -0700, jrs_66 wrote:
> Thanks! This is a great starting point. My real queryset requires me
> to go a few joins deeper, however. I will try nesting loops to get
> there, but this seems frightfully like querying in a loop (maybe I'm
> wrong, I'll check the end query t
Phil,
Thanks for the pointers. I guess my thinking on this is that if
someone feels a question is too trite to warrant and answer, they
shouldn't answer. I don't think this group is called 'advanced django
users', thus I don't really feel bad for posting 'newbie' questions.
I appreciate all ans
Thanks! This is a great starting point. My real queryset requires me
to go a few joins deeper, however. I will try nesting loops to get
there, but this seems frightfully like querying in a loop (maybe I'm
wrong, I'll check the end query to find out). It also seems like a
frightening amount of
On Wed, May 6, 2009 at 8:48 PM, jrs_66 wrote:
>
> Hi,
>
> I have 2 models...
>
[skip]
>
> e = FlattenedCategory.objects.select_related('category').filter
> (member_of_category=15)
>
> which works... This, however, doesn't
>
> e = e.category
>
> How do I access the related records from the Cat
On Wed, May 06, 2009 at 10:17:29AM -0700, jrs_66 wrote:
> This is definitely the most angry forum I've ever seen... the
> kicker is that the anger is almost always coming from the people
> associated with the django project... hmmm..
In your previous thread, someone from the Django project helpfu
>
> In your case e is a QuerySet, with multiple FlattenedCategory objects.
>
> So the proper code would be to loop through them:
>
> {{{
> for fc in e:
> fc.category_set
> }}}
>
Indeed,
but category being a ForeignKey field,
{{{
for fc in e:
fc.category
}}}
will work here.
--
Clément
--
In your case e is a QuerySet, with multiple FlattenedCategory objects.
So the proper code would be to loop through them:
{{{
for fc in e:
fc.category_set
}}}
On 5/6/2009 10:17 AM, jrs_66 wrote:
> No... 'QuerySet' object has no
> attribute 'category_set'
>
> George,
>
> I have read the
jrs_66:
you may find some comfort in the
http://ubuntuforums.org/forumdisplay.php?f=39
forum - not specific to django, but quite a friendly bunch and lots of
python folks willing to assist with the learning process.
tag your posts with 'django'
On May 6, 2:17 pm, jrs_66 wrote:
>
> This is defi
No... 'QuerySet' object has no
attribute 'category_set'
George,
I have read the docs... MANY times... from the docs...
'Django also creates API accessors for the "other" side of the
relationship -- the link from the related model to the model that
defines the relationship. For example, a Blog
On 5/6/2009 9:48 AM, jrs_66 wrote:
> I have 2 models...
>
> class Category(models.Model):
> name = models.CharField(max_length=255)
> parent = models.ForeignKey('self', null=True)
> has_children = models.BooleanField(default=False)
> language = models.ForeignKey(Language, null=Fal
Hi,
I have 2 models...
class Category(models.Model):
name = models.CharField(max_length=255)
parent = models.ForeignKey('self', null=True)
has_children = models.BooleanField(default=False)
language = models.ForeignKey(Language, null=False, default=1)
active = models.BooleanFi
11 matches
Mail list logo