#3288: ForeignKey to 'self' and select_related() = infinite recursion
-----------------------------------------------+----------------------------
Reporter: Max Derkachev <[EMAIL PROTECTED]> | Owner: PhiR
Status: assigned | Component:
Database wrapper
Version: SVN | Resolution:
Keywords: qs-rf | Stage: Ready
for checkin
Has_patch: 1 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 1
-----------------------------------------------+----------------------------
Changes (by pkenjora):
* needs_better_patch: 0 => 1
Comment:
I applied 3288_96.diff with no effect. My model is:
class ProjectImage(models.Model):
project = models.ForeignKey("Project", null=True, edit_inline=True,
core=True)
title = models.CharField(maxlength=50, blank=True)
description = models.TextField(blank=True)
image = models.ImageField(upload_to='project', height_field="100",
width_field="100", blank=False)
faqs = models.ManyToManyField(Faq, blank=True)
categories = models.ManyToManyField(Category)
class Project(models.Model):
title = models.CharField(maxlength=50)
description = models.TextField()
pub_date = models.DateTimeField(auto_now_add=True)
icon = models.ForeignKey(ProjectImage, edit_inline=True, core=True,
related_name='icon')
parts = models.ManyToManyField(Part)
cars = models.ManyToManyField(Car)
faqs = models.ManyToManyField(Faq, blank=True)
The patch does not break any functionality but I still encounter the same
error.
Exception Type: RuntimeError
Exception Value: maximum recursion depth exceeded in cmp
Exception Location:
/home/patrickm/lib/python2.4/django/db/models/fields/__init__.py in
get_follow, line 328
--
Ticket URL: <http://code.djangoproject.com/ticket/3288#comment:7>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---