django - 'ForeignRelatedObjectsDescriptor' object has no attribute 'all' -
I am taking on Django 1.7 your web application and I'm probably very curious mistake Perhaps one of you know that this happens.
class products (models.Model): title = model. Kharefild (max_link = 100) slug = model Slufffield () Material = Model. TextField () Category Gallery (models.Model): Product = Model. Foreign (product, related_name = "picture") original = model. Image Field () class MyView (DetailView): Model = product def get_context_data (self, ** kwargs): ... # # # # # # # # # "galleries"] = Utpadkimajkol () 'foreign-related Object descriptor 'does not contain' all 'response in the object. )
Try:
context [ " galleries "] = Self.object.images.all ()
If you want to call on a specific example of your product
model, which your object Should be there.
Comments
Post a Comment