Commit 60d00cbb authored by chris's avatar chris

django 1.7: Creating a ModelForm without either the 'fields' attribute or the...

django 1.7: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is deprecated
parent 800107b6
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(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment