I have sticky bug I can  not figure out how to solve.

On the dev server it works fine, but moving to mod_python...

I'm running a query and it throws an exception, but if I reload the
page it works fine.

the model has this structure:

class InfoProxy(models.Model):
    info_type = models.ForeignKey(ContentType,
related_name='infoproxies')
    info_id = models.PositiveIntegerField()
    info_item = models.GenericForeignKey(ct_field="info_type",
fk_field="info_id")
    created = models.DateTimeField('date created')
    modified = models.DateTimeField('date modified')
    owner = models.ForeignKey(User)

class Permission(models.Model):
     info_proxy = models.ForeignKey(InfoProxy,
related_name='permissions')
     permission_type = models.CharField(maxlength=1,
choices=PERMISSION_CHOICES)
     usergroup =   models.ForeignKey(UserGroup)

     def __str__(self):
         try:
             return 'Item:%s  Proxy:%s  %s  %s' %
(str(self.info_proxy.getItem().id), str(self.info_proxy.id),
                       self.permission_type, str(self.usergroup_id))
         except:
             return 'Item:MISSING Proxy:%s  %s  %s' %
(str(self.info_proxy.id), self.permission_type,
                       str(self.usergroup_id))


The problem occurs when running a query like:

self.all().filter(permissions__usergroup__in=group_idents).distinct()

When running admin and listing 'permissions' I notice that MISSING
proxy is displayed, but when pressing refresh it works like it should.

My guess is that there is something wrong in loading the classes/
models.
Could it be related to http://code.djangoproject.com/ticket/2438

Any hints in debugging this or how to move forward is welcome

regards
Sten


--~--~---------~--~----~------------~-------~--~----~
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