0
我在模型表單上有多對多字段和一個外鍵字段。它似乎在做正確的查詢,但結果是對象而不是對象的值。Django模型表單多對多字段不顯示值
是否需要使用VALUES_LIST方法覆蓋查詢集?
forms.py
class Meta:
model = AccountParameters
fields =['acctFilterName', 'excludeClassification', 'tradingCash',]
#exclude = ['acctFilterName']
labels = {
'acctFilterName': _('Account Filters:'),
'excludeClassification': _('Exclude Classifications: '),
'tradingCash':_('Remove accounts whose trading cash < % of AUM: ')
}
models.py
class AccountParameters(models.Model):
acctFilterName = models.ForeignKey(AccountFilters)
excludeClassification = models.ManyToManyField(ClassificationNames)
tradingCash = models.FloatField()