【发布时间】:2010-11-28 00:59:55
【问题描述】:
我的模型是这样的
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(..)
我想获取所有具有 user__username = 'hello' 的 bar、baz(和其他 FooSubclasses)
我愿意Foo.objects.filter(user__username = 'hello')。这给了我一个错误'Options' object has no attribute '_join_cache'
我该怎么做?
【问题讨论】:
-
此页面中的一些信息可能会有所帮助stackoverflow.com/questions/7884359/…
标签: django django-models