You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This feature will make life much simpler in e-commerce projects, where we need to create some constructions like:
class Image(models.Model):
image = models.ImageField()
class Product(models.Model):
name = models.CharField()
class ProductImage(models.Model):
image = models.ForeignKey(Image)
product = models.ForeignKey(Product)
Module can't access to Image fields using ForeignKey atributes.
AttributeError 'ForeignKey' object has no attribute 'get_internal_name'
Maybe I missed something in documentation?
The text was updated successfully, but these errors were encountered:
It would be useful to support this for sure. It’s not currently possible, though you can work around the limitation by adding a property on one model that returns the image field on the related model. I just added that feature recently.
I’ll have a think about how best to support ForeignKey relations. Maybe we could use the double-underscore syntax Django uses for various related lookups.
This feature will make life much simpler in e-commerce projects, where we need to create some constructions like:
Module can't access to Image fields using ForeignKey atributes.
AttributeError 'ForeignKey' object has no attribute 'get_internal_name'
Maybe I missed something in documentation?
The text was updated successfully, but these errors were encountered: