summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoretienne <etienne@07715635-78ed-41b0-aaf1-0afda6c37f35>2008-10-08 19:44:15 +0000
committeretienne <etienne@07715635-78ed-41b0-aaf1-0afda6c37f35>2008-10-08 19:44:15 +0000
commitc35b127f729015dec19a039ca4173df845cb24eb (patch)
tree7885552d4f93c492732a467db562fe59e5f69c61
parent5b13731e4c899e86cabf3c6eb7e343b178d70f05 (diff)
downloadPapillon-c35b127f729015dec19a039ca4173df845cb24eb.tar.bz2
Papillon-c35b127f729015dec19a039ca4173df845cb24eb.zip
Some minor changes for Django 1.0
-rw-r--r--polls/models.py20
-rw-r--r--templates/createOrEdit.html2
-rw-r--r--templates/main.html2
-rw-r--r--templates/vote.html2
-rw-r--r--urls.py5
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>
diff --git a/urls.py b/urls.py
index 018eb38..9db8686 100644
--- a/urls.py
+++ b/urls.py
@@ -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/'}),
)