From 60d00cbbfe0682d731b9c950d07e73c1068c77fc Mon Sep 17 00:00:00 2001 From: Christophe Siraut Date: Sat, 25 Oct 2014 13:19:50 +0200 Subject: [PATCH] django 1.7: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is deprecated --- meetingpoll/forms.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/meetingpoll/forms.py b/meetingpoll/forms.py index 58296a0..aac9d96 100644 --- a/meetingpoll/forms.py +++ b/meetingpoll/forms.py @@ -1,7 +1,7 @@ from django import forms from .models import UserProfile, Poll, Choice, Bulletin, Vote from django.utils.translation import ugettext_lazy as _ -from datetime import datetime, timedelta +from datetime import datetime from datetimewidget.widgets import DateTimeWidget dateTimeOptions = { @@ -18,6 +18,7 @@ class UserProfileForm(forms.ModelForm): model = UserProfile fields = ('email_notifications',) + class DateTimeWidgetFixed(DateTimeWidget): def __init__(self, **kwargs): super(DateTimeWidgetFixed, self).__init__(**kwargs) @@ -53,9 +54,12 @@ class ChoiceForm(forms.ModelForm): # options=dateTimeOptions)} exclude = ('poll', 'votecount') + class BulletinForm(forms.ModelForm): class Meta: model = Bulletin + exclude = [] + class VoteForm(forms.ModelForm): comment = forms.CharField( -- GitLab