class Department(models.Model):
dept_name = models.CharField(max_length=100,required=True)
section_name = models.CharField(max_length=100,required=True)
class User(models.Model):
name = models.CharField(max_length=100, required=True)
dept = models.ForeignkeyField(Department, on_delete=models.CASCADE, required=True)
addr = models.TextField(required=True)
我想使用表单从Ember front end
向用户模型输入一个值,然后如何将该值提供给dept
字段?
(假设已经填充了Department模型)