Commit 9d449258 authored by christophe siraut's avatar christophe siraut
Browse files

nettoyage modèles, on oublie les sondages non-rendez-vous pour le moment

parent 279af6d1
import os
from django.db import models
#from django.utils.translation import ugettext_lazy as _
from binascii import hexlify
from django.db import models
from django.utils.translation import ugettext_lazy as _
def _createId():
# Generate a 4 caracters id
return hexlify(os.urandom(2))
class Poll(models.Model):
# Override django id AutoField with randomly generatyed hash
id = models.CharField(primary_key=True,unique=True,max_length=8,default=_createId)
title = models.CharField('Question',max_length=50)
pub_date = models.DateField('date published',auto_now_add=True)
upd_date = models.DateField('date updated',auto_now=True)
author = models.CharField(max_length=20)
description = models.CharField(max_length=200)
#public = models.BooleanField()
title = models.CharField(_('Title'),max_length=80)
pub_date = models.DateField(auto_now_add=True)
upd_date = models.DateField(auto_now=True)
author = models.CharField(max_length=40)
description = models.CharField(max_length=300)
def __unicode__(self):
return self.title
......@@ -30,15 +28,6 @@ class Choice(models.Model):
def __unicode__(self):
return str(self.choice) # hacky?
class NodateChoice(models.Model):
poll = models.ForeignKey(Poll)
choice = models.CharField(max_length=80)
details = models.CharField(max_length=120,blank=True)
votecount = models.IntegerField(default=0,blank=True)
def __unicode__(self):
return self.choice
class Bulletin(models.Model):
poll = models.ForeignKey(Poll,editable=False)
voter = models.CharField("",max_length=40)
......@@ -55,7 +44,6 @@ class Vote(models.Model):
def __unicode__(self):
return self.voice
# First, define the Manager subclass.
class VoteBuletin(models.Manager):
......@@ -154,13 +154,14 @@ form label {
width: 180px;
padding: 8px;
margin: 8px;
-moz-border-radius: 9px;
-webkit-border-radius: 9px;
border: 1px solid #efefff;
-moz-border-radius: 13px;
-webkit-border-radius: 13px;
border: 1px solid #fff;
.icone:hover {
background-color: #f7f7ff;
border: 1px solid #efefff;
.indent {
......@@ -13,7 +13,7 @@
<p class="info">
{% trans "Create polls easily, and publish them for your mates. You may poll on dates or any subject, in order to plan meetings or get a group opinion." %}
{% trans "Create polls easily, and publish them for your mates, in order to plan meetings or else." %}
{% endblock %}
......@@ -24,16 +24,15 @@
<img width="24px" src="/static/images/view-calendar-list.png" alt="Make a poll"> &nbsp; {% trans "New poll" %}</p></a> </div>
<a href="/new/" title="Make an poll" alt="Make an event"><p class="icone">
<a href="/new/" title="{% trans "Make an event" %}" alt="Make an event"><p class="icone">
<img width="24px" src="/static/images/view-calendar-day-2.png"> &nbsp; &nbsp; {% trans "Shedule an event" %}</p></a>
<a href="/nuages" title="Make an event" alt="Learn more"><p class="icone">
<a href="/nuages" title="{% trans "About nuages" %}" alt="Learn more"><p class="icone">
<img width="24px" src="/static/images/document-send.png"> &nbsp; {% trans "About nuages" %}</p></a>
<br /><div style="display:block;clear:both"></div> <br /><br />
{% if user.is_authenticated %}
<h3>{% trans "My polls" %}</h3>
......@@ -68,6 +67,3 @@
{% endblock %}
......@@ -16,11 +16,11 @@
{% block content %}
<br /><br /><br />
<br /><br />
<div id="notify" class="blue">
<ol> <b>nuage</b> /ny.aʒ/<br /><br />
<ol style="width:50%"> <b>nuage</b> /ny.aʒ/<br /><br />
<li> (Météorologie) Amas de gouttelettes d’eau maintenues en suspension dans l’atmosphère et qui se résolvent ordinairement en pluie.
Supports Markdown
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