【发布时间】:2019-02-04 16:59:03
【问题描述】:
models.py
class InfraServiceInfo(db.Model):
app_name = db.CharField(choices=VIEW_APP_CHOICES, max_length=1000)
stack = db.CharField(max_length=1000)
description = db.TextField('InfraServiceInfo', choices=VIEW_DESC_CHOICES)
描述与 InfraServiceInfo 表中的每个 app_name 相关联。 As app_name is a drop down list, when the selects a particular app_name the corresponding description associated with that app_name should be auto populated in the forms.
示例:app_name = "test",description = "testing" 和 app_name = “test2”,描述 = “testing2”。 当用户从下拉列表中选择测试时,描述应自动填充测试字符串。我该怎么做?
【问题讨论】:
标签: django python-3.x django-models django-forms django-views