2
我的模型是这样的.filter跨表中的抽象模型类 - Django的
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(..)
我想所有的酒吧,巴兹(和其他FooSubclasses),其中有user__username =“你好”
我做Foo.objects.filter(user__username = 'hello')
。这给我一个错误'Options' object has no attribute '_join_cache'
我该怎么做?
本页面中的部分信息可能会对您有所帮助 http://stackoverflow.com/questions/7884359/foreignkey-to-abstract-class-generic-relations – 2012-10-08 12:21:37