hi Jeremy

i think i found my mistake...

i had this in the model:

###
class Storycomment(models.Model):
    user = models.ForeignKey(User)
    story = models.ForeignKey(Story, related_name='comment_set')
    show = models.BooleanField(default=True)
    trashed = models.BooleanField(default=False)
    comment = models.TextField()
    parent = models.ForeignKey('self', blank=True, null=True, 
related_name='child_set')
    from_ip = models.CharField(maxlength=40, editable=False, blank=True)
    created = models.DateTimeField('date created', auto_now_add=True)
    updated = models.DateTimeField('date modified',  auto_now=True)
   
    def __str__(self):
        return self.user.username + ":" + self.comment[0:25]
   
    class Meta:
        ordering = ['created']
        verbose_name_plural = 'Comments'
   
    objects = StorycommentManager() 
   
    def is_parent(self):
        if self.parent is None or self.parent == "":
            return True
        return False

###

when i remove the "is_parent" function things go much better :-)
thank you

alain






Jeremy Dunck wrote:
> On 3/22/07, alain <[EMAIL PROTECTED]> wrote:
> ...
>   
>> but for each "parent" fk that is not null i have a db request that
>> goes get the self referenced comment:
>>     
>
> That's unusual.  Please show your view and template code; something
> you're doing is causing the additional lookups, I think.
>
> >
>
>   


--~--~---------~--~----~------------~-------~--~----~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to