请问有人能解释一下我在下面的shell输出中看到的内容吗:
import test/models.py
biz_area = BusinessArea.objects.filter(business_area_manager=user)
dprint(biz_area)
[{'_state': <django.db.models.base.ModelState object at 0x3726890>,
'business_area_id': Decimal('42'),
'business_area_manager': Decimal('999'),
'business_area_name': u'group 1',
'inactive': u'N'}]
biz_area.business_area_id
Traceback (most recent call last):
File "<<console>console>", line 1, in <<module>module>
AttributeError: 'QuerySet' object has no attribute 'business_area_id'
因此,Python提示说biz_area queryset没有'business_area_id'属性,但对象的漂亮打印列表显示它确实具有这样的属性。有人能否帮助我找到正确的方向,因为这让我感到困惑...
biz_area['business_area_id']
是什么意思? - Matthiasbiz_area
是一个对象集合。 - dm03514