.filter via tables in abstract model class - Django
My model is like this
class Foo(models.Model):
user = models.ForeignKey(User)
class Meta:
abstract = True
class Bar(Foo):
bar_thing = models.CharField(..)
class Baz(Foo):
baz_thing = models.CharField(..)
I want to get all bars, baz (and other FooSubclasses) that have user__username = 'hello'
i do Foo.objects.filter(user__username = 'hello')
. This is giving me error'Options' object has no attribute '_join_cache'
How can i do this?
+2
source to share