#9889: Admin error when using extra fields on many-to-many relationships
----------------------------------+-----------------------------------------
Reporter: tolano | Owner: nobody
Status: new | Milestone:
Component: django.contrib.admin | Version: SVN
Keywords: | Stage: Unreviewed
Has_patch: 0 |
----------------------------------+-----------------------------------------
http://docs.djangoproject.com/en/dev/topics/db/models/#extra-fields-on-
many-to-many-relationships
I have created a models similar to the one in the docs. Previously the
admin was working ok, but when I changed the model to include extra fields
in the m2m relationship, the admin broke.
The models code:
{{{
class Coach(models.Model):
user = models.OneToOneField(User)
customers = models.ManyToManyField(User, related_name = 'customers',
through='CustomerCoach')
class CustomerCoach(models.Model):
user = models.ForeignKey(user)
coach = models.ForeignKey(Coach)
date_joined = models.DateTimeField()
}}}
The admin code:
{{{
class CustomersCoachAdmin(admin.ModelAdmin):
pass
admin.site.register(CustomersCoachAdmin, CustomerCoach)
}}}
I get this error:
{{{
'MediaDefiningClass' object is not iterable
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/9889>
Django <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
-~----------~----~----~----~------~----~------~--~---