Hello all!
I have this models:
class Article(models.Model):
name = models.CharField(...)
class Sale(models.Model):
...
class SaleItems(models.Model):
article = models.ForeignKey(Article)
And the Admin:
class SaleAdmin(admin.ModelAdmin):
search_fields = ('...', < and here is the problem >
I want that in the Sale Index Page look all the sales that have sold the article "A"
To accomplished that I tried: 'saleitems__article__name' and it throws the following error:
"
Related Field got invalid lookup: icontains"
Is there a way to do the reverse lookup in search_fields?
Thanks id advance