diff options
-rw-r--r-- | polls/models.py | 20 | ||||
-rw-r--r-- | templates/createOrEdit.html | 2 | ||||
-rw-r--r-- | templates/main.html | 2 | ||||
-rw-r--r-- | templates/vote.html | 2 | ||||
-rw-r--r-- | urls.py | 5 |
5 files changed, 16 insertions, 15 deletions
diff --git a/polls/models.py b/polls/models.py index bf9ef15..26e53f9 100644 --- a/polls/models.py +++ b/polls/models.py @@ -25,26 +25,26 @@ from django.db import models from django.utils.translation import gettext_lazy as _ class PollUser(models.Model): - name = models.CharField(maxlength=100) - email = models.CharField(maxlength=100) - password = models.CharField(maxlength=100) + name = models.CharField(max_length=100) + email = models.CharField(max_length=100) + password = models.CharField(max_length=100) modification_date = models.DateTimeField(auto_now=True) class Poll(models.Model): - name = models.CharField(maxlength=200) - description = models.CharField(maxlength=1000) + name = models.CharField(max_length=200) + description = models.CharField(max_length=1000) author = models.ForeignKey(PollUser) - base_url = models.CharField(maxlength=100) - admin_url = models.CharField(maxlength=100) + base_url = models.CharField(max_length=100) + admin_url = models.CharField(max_length=100) modification_date = models.DateTimeField(auto_now=True) STATUS = (('A', _('Available')), ('D', _('Disabled')),) - status = models.CharField(maxlength=1, choices=STATUS) + status = models.CharField(max_length=1, choices=STATUS) TYPE = (('P', _('Poll')), ('B', _('Balanced poll')), ('O', _('One choice poll')),) # ('M', _('Meeting')),) - type = models.CharField(maxlength=1, choices=TYPE) + type = models.CharField(max_length=1, choices=TYPE) def getTypeLabel(self): idx = [type[0] for type in self.TYPE].index(self.type) @@ -63,7 +63,7 @@ class Voter(models.Model): class Choice(models.Model): poll = models.ForeignKey(Poll) - name = models.CharField(maxlength=200) + name = models.CharField(max_length=200) order = models.IntegerField() limit = models.IntegerField(null=True) available = models.BooleanField(default=True) diff --git a/templates/createOrEdit.html b/templates/createOrEdit.html index 0c223ff..e76decd 100644 --- a/templates/createOrEdit.html +++ b/templates/createOrEdit.html @@ -1,5 +1,5 @@ -{% load i18n %} {% extends "base.html" %} +{% load i18n %} {% block content %} {% if not new and not choices %} diff --git a/templates/main.html b/templates/main.html index 0ca4536..05c8b95 100644 --- a/templates/main.html +++ b/templates/main.html @@ -1,5 +1,5 @@ -{% load i18n %} {% extends "base.html" %} +{% load i18n %} {% block content %} {% if error %}<p class='error'>{{error}}</p>{%endif%} diff --git a/templates/vote.html b/templates/vote.html index 3ca4e34..f3f1e1d 100644 --- a/templates/vote.html +++ b/templates/vote.html @@ -1,5 +1,5 @@ -{% load i18n %} {% extends "base.html" %} +{% load i18n %} {% block content %} <h2>{{poll_type_name}} - {{poll_name}}</h2> @@ -20,11 +20,12 @@ from django.conf.urls.defaults import * urlpatterns = patterns('', - (r'^papillon/admin/', include('django.contrib.admin.urls')), + (r'^admin/', include('django.contrib.admin.urls')), (r'^papillon/$', 'papillon.polls.views.index'), (r'^papillon/edit/(?P<admin_url>\w+)/$', 'papillon.polls.views.createOrEdit'), (r'^papillon/poll/(?P<poll_url>\w+)/$', 'papillon.polls.views.poll'), (r'^papillon/poll/(?P<poll_url>\w+)/vote$', 'papillon.polls.views.poll'), - (r'^papillon/static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': '/var/local/django/papillon/static/'}), + (r'^static/(?P<path>.*)$', 'django.views.static.serve', + {'document_root': 'static/'}), ) |