Python 是否可以将选择字段选择映射到django中的外键 models.py 管理员

Python 是否可以将选择字段选择映射到django中的外键 models.py 管理员,python,django,django-models,django-forms,Python,Django,Django Models,Django Forms,我试图首先添加一个选择字段,如果选择类型是client,我想获取客户端名称和图像 错误 无法在数据库中动态添加列。@SadanA.Oh Ok。。谢谢你。。是否可以隐藏/显示下一个选项? class Testimonials(models.Model): client = 'client' employee = 'employee' general = 'general' Testimonial_Choices = ( ('client', 'client'), ('employe

我试图首先添加一个选择字段,如果选择类型是client,我想获取客户端名称和图像

错误
无法在数据库中动态添加列。@SadanA.Oh Ok。。谢谢你。。是否可以隐藏/显示下一个选项?
class Testimonials(models.Model):
client = 'client'
employee = 'employee'
general = 'general'
Testimonial_Choices = (
    ('client', 'client'),
    ('employee', 'employee'),
    ('general', 'general'),
)
testimonial_type=models.CharField(max_length=25, choices=Testimonial_Choices, default=client)
if testimonial_type=='client':
    client_name= models.ForeignKey(Client, on_delete=models.CASCADE)
content= models.TextField(max_length=500, blank=False)
posted_date= models.DateField(auto_now_add=True)

def __str__(self):
    return self.client_name
class TestimonialAdmin(admin.ModelAdmin):
list_display = ('testimonial_type', 'posted_date')
list_filter = ('testimonial_type', 'posted_date')
search_fields = ['testimonial_type', 'posted_date']
empty_value_display = '-- NA --'
list_per_page = 10
admin.site.register(Testimonials, TestimonialAdmin)
AttributeError: 'Testimonials' object has no attribute 'client_name'