我有Movie和MovieDescription模型,因此我想为这两个模型创建输入表单。我希望输入可以采用一种联合形式,其中将包含以下字段:标题,directed_by,类型,年份,比率,简介。
class Movie(models.Model):
title = models.CharField(max_length=50, verbose_name='Title')
directed_by = models.CharField(max_length=50, null=True, blank=True, verbose_name='Directed by')
genre = models.CharField(max_length=90, null=True, blank=True, verbose_name='Genre')
year = models.IntegerField(verbose_name='Year')
class MovieDescription(models.Model):
movie = models.OneToOneField('Movie', on_delete=models.CASCADE, null=True)
synopsis = models.TextField(null=True, blank=True, verbose_name='Synopsis')
rate = models.FloatField(null=True, blank=True, verbose_name='Rate')
为此我找不到最合适的django2.2工具。