I am moving my web application to Django 1.7 and I have a very curious mistake, maybe one of you knows what is going on.
class Product(models.Model):
title = models.CharField(max_lenght=100)
slug = models.SlugField()
content = models.TextField()
class Gallery(models.Model):
product = models.ForeignKey(Product, related_name="images")
original = models.ImageField()
class MyView(DetailView):
model = Product
def get_context_data(self, **kwargs):
....
context["galleries"] = Product.images.all()
Run the following error message:
'ForeignRelatedObjectsDescriptor' object has no attribute 'all'
response = wrapped_callback(request, *callback_args, **callback_kwargs)
source
share