Py学习  »  Django

基于Django类的CreateView中的Formset

Gabrial Johnas • 4 年前 • 398 次点击  

模型

class Timetable(models.Model):
    day = models.CharField(max_length=9,choices=timetable_choices)
    start = models.IntegerField()
    end = models.IntegerField()
    period = models.CharField(max_length=12)

意见

class Timetableadding(CreateView):
    model =  Timetable
    fields = ['day','period','start' ,'end']
    success_url = '/dashboard'

我需要的是处理类似于下图的视图, enter image description here

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/57066
 
398 次点击  
文章 [ 2 ]  |  最新文章 4 年前