方便之处在于,我们不会再一遍一遍的写form的样式了。 from django import forms class BootStrapModelForm(forms.ModelForm): def __init__(self, *args, **kwargs): super(BootStrapMo Read More
posted @ 2022-09-01 15:45 角角边 Views(113) Comments(0) Diggs(0) Edit
简单来讲: 如果你想传入前端的页面中附带值,那么在实例化forms中: form = SecondModelForm(data=request.POST, instance=permission_obj) return render(request, 'rbac/change.html', {'fo Read More
posted @ 2022-09-01 15:25 角角边 Views(71) Comments(0) Diggs(0) Edit