-
Notifications
You must be signed in to change notification settings - Fork 6
Description
The setup:
class QUser(models.Model):
username = models.CharField(max_length=30, unique=True)
objects = CacheBotManager()
class QInternalMessage(models.Model):
subject = models.CharField(max_length=120)
parent_msg = models.ForeignKey('self', related_name='next_message', null=True, blank=True, )
recipient = models.ForeignKey(QUser, null=True, blank=True, related_name='messages_received', db_index=True)
objects = CacheBotManager()
This hits an infinite loop...
rp = QInternalMessage.objects.select_related('parent_msg').get(id=1)
rp.subject='frick'
rp.save()
This hits an exception here: /cachebot/queryset.py in _get_related_models:
related_models.add((rev_reversemapping[attname], related.model))
rs = QInternalMessage.objects.cache().filter(recipient=user1)
for r in rs.all():
print r.subject
Anyone out there deal with this issue yet?