Commit 9e745f6b authored by Aymeric Barantal's avatar Aymeric Barantal

define some blank fields, and report correct entity name

parent 643e8d08
...@@ -8,8 +8,11 @@ class Contact(models.Model): ...@@ -8,8 +8,11 @@ class Contact(models.Model):
first_name = models.CharField(max_length=64) first_name = models.CharField(max_length=64)
last_name = models.CharField(max_length=64) last_name = models.CharField(max_length=64)
phone = models.CharField(max_length=32) phone = models.CharField(max_length=32)
twitter = models.CharField(max_length=64) twitter = models.CharField(max_length=64, blank=True)
mail = models.CharField(max_length=255) mail = models.CharField(max_length=255, blank=True)
def __unicode__(self):
return '%s %s' % (self.first_name, self.last_name)
class Group(models.Model): class Group(models.Model):
...@@ -17,20 +20,26 @@ class Group(models.Model): ...@@ -17,20 +20,26 @@ class Group(models.Model):
id = models.AutoField(primary_key=True) id = models.AutoField(primary_key=True)
organisation_id = models.ForeignKey(Organization) organisation_id = models.ForeignKey(Organization)
name = models.CharField(max_length=64) name = models.CharField(max_length=64)
type = models.CharField(max_length=255) type = models.CharField(max_length=255, blank=True)
media = models.CharField(max_length=255) media = models.CharField(max_length=255, blank=True)
contacts = models.ManyToManyField(Contact) contacts = models.ManyToManyField(Contact)
def __unicode__(self):
return self.name
class Campaign(models.Model): class Campaign(models.Model):
"""Campaign model, describe what have to be achieved""" """Campaign model, describe what have to be achieved"""
id = models.AutoField(primary_key=True) id = models.AutoField(primary_key=True)
title = models.CharField(max_length=255) title = models.CharField(max_length=255)
description = models.CharField(max_length=512) description = models.CharField(max_length=512, blank=True)
start_date = models.DateTimeField() start_date = models.DateTimeField()
end_date = models.DateTimeField() end_date = models.DateTimeField()
default_lang = models.CharField(max_length=5) default_lang = models.CharField(max_length=5)
def __unicode__(self):
return self.title
class Argumentary(models.Model): class Argumentary(models.Model):
id = models.AutoField(primary_key=True) id = models.AutoField(primary_key=True)
......
...@@ -6,4 +6,7 @@ class Organization(models.Model): ...@@ -6,4 +6,7 @@ class Organization(models.Model):
id = models.AutoField(primary_key=True) id = models.AutoField(primary_key=True)
name = models.CharField(max_length=64) name = models.CharField(max_length=64)
sip_key = models.CharField(max_length=255) sip_key = models.CharField(max_length=255)
users = models.ForeignKey(User) users = models.ForeignKey(User, blank=True)
def __unicode__(self):
return self.name
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