Ajax/POSTを使用してモデルを更新しようとしています。フォームのすべてのフィールドではなく、更新中のフィールドを送信できるようにしたいと思います。しかし、これによりフォームが無効になるようです。これを行う良い方法はありますか?
例えば:
class Video(models.Model):
name = models.CharField(max_length=100)
type = models.CharField(max_length=100)
owner = models.ForeignKey(User, related_name='videos')
...
#Related m2m fields
....
class VideoForm(modelForm):
class Meta:
model = Video
fields = ('name', 'type', 'owner')
class VideoCreate(CreateView):
template_name = 'video_form.html'
form_class = VideoForm
model = Video
名前を更新するときに、このデータを使用してPOSTを送信したい
{'name': 'new name'}
とは対照的に
{'name': 'new name', 'type':'existing type', 'owner': 'current owner'}
同様にタイプを更新します。
これを行う良い方法はありますか?