I get an AttributeError on deleting an object with a
ManyToManyField('self'). The error is below. My Django is an svn
checkout from yesterday.
I understand that there should be no mediaset_set attribute because the
many-to-many relationship is symmetrical, as documented here:
http://www.djangoproject.com/documentation/model_api/
Is there a bug in the admin interface's delete? Or am I doing
something wrong?
AttributeError at /mtimedia/admin/MediaApp/mediaset/2/delete/
'MediaSet' object has no attribute 'mediaset_set'
Request Method: GET
Request URL:
http://carter.dyndns.org:8000/mtimedia/admin/MediaApp/mediaset/2/delete/
Exception Type: AttributeError
Exception Value: 'MediaSet' object has no attribute 'mediaset_set'
Exception Location:
/usr/lib/python2.3/site-packages/django/contrib/admin/views/main.py in
_get_deleted_objects, line 465
My models.py:
from django.db import models
class Use(models.Model):
Use = models.CharField('use', maxlength=200)
def __str__(self):
return self.Use
class Admin:
pass
class Rights(models.Model):
Rights = models.CharField('rights', maxlength=200)
def __str__(self):
return self.Rights
class Admin:
pass
class MediaSet(models.Model):
PubDate = models.DateTimeField('date published')
ObtainedFrom = models.CharField('obtained from', maxlength=200)
ObtainedDate = models.DateTimeField('date obtained')
Uses = models.ManyToManyField(Use)
Rights = models.ForeignKey(Rights)
Film = models.CharField(maxlength=200)
RelativePath = models.CharField(maxlength=100)
RelatedMediaSets = models.ManyToManyField('self', blank=True)
Notes = models.TextField()
def __str__(self):
return str(self.id) + ', \\\\media\\share\\' +
self.RelativePath
class Admin:
pass
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" 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-users
-~----------~----~----~----~------~----~------~--~---