i have asked a question about manytomanyfield here which i solved but now a new problem is raised as,
DatabaseError at /admin/myapp/photo/8/delete/
relation "woek_gallery_photos" does not exist
LINE 1: DELETE FROM "woek_gallery_photos" WHERE "photo_id" IN ...
i know why this problem raises but i dont know how to. i have one Photo model which has relation with both Group model and Gallery model. when i add an image from Gallery it works good but as to deleting it, raises problem with Group about not having any relation...
class Gallery(models.Model):
....
photos = models.ManyToManyField('Photo', related_name='galleries',
verbose_name=_('Gallery'),
null=True, blank=True)
class Group(models.Model):
...
photos = models.ManyToManyField('Photo', related_name='galleries',
verbose_name=_('Group'),
null=True, blank=True,
through='through=GroupPhotos')
class Photo(models.Model):
image = models.ImageField(verbose_name = "Browse",
upload_to=myPath)
I appreciate your all helping.