Commit ef09ff0f authored by Jean-Baptiste Pasquier's avatar Jean-Baptiste Pasquier

fix: add null values to fields

parent 228b22af
# -*- coding: utf-8 -*-
# Generated by Django 1.11.26 on 2019-12-09 17:12
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('djangoldp_project', '0002_member_is_admin'),
]
operations = [
migrations.AlterModelOptions(
name='member',
options={},
),
migrations.AlterField(
model_name='customer',
name='address',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AlterField(
model_name='customer',
name='companyRegister',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AlterField(
model_name='customer',
name='email',
field=models.EmailField(blank=True, max_length=254, null=True),
),
migrations.AlterField(
model_name='customer',
name='firstName',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AlterField(
model_name='customer',
name='lastName',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AlterField(
model_name='customer',
name='phone',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AlterField(
model_name='customer',
name='role',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AlterField(
model_name='member',
name='name',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AlterField(
model_name='project',
name='description',
field=models.TextField(blank=True, null=True),
),
migrations.AlterField(
model_name='project',
name='driveID',
field=models.TextField(blank=True, null=True),
),
migrations.AlterUniqueTogether(
name='member',
unique_together=set([('user', 'project')]),
),
]
import random
import string
from django.conf import settings
from django.db import models
from django.dispatch import receiver
......@@ -9,14 +11,14 @@ from .permissions import ProjectPermissions, ProjectMemberPermissions
class Customer(Model):
name = models.CharField(max_length=255)
address = models.CharField(max_length=255, blank=True)
address = models.CharField(max_length=255, null=True, blank=True)
logo = models.URLField(blank=True, null=True)
companyRegister = models.CharField(max_length=255, blank=True)
firstName = models.CharField(max_length=255, blank=True)
lastName = models.CharField(max_length=255, blank=True)
role = models.CharField(max_length=255, blank=True)
email = models.EmailField(blank=True)
phone = models.CharField(max_length=255, blank=True)
companyRegister = models.CharField(max_length=255, null=True, blank=True)
firstName = models.CharField(max_length=255, null=True, blank=True)
lastName = models.CharField(max_length=255, null=True, blank=True)
role = models.CharField(max_length=255, null=True, blank=True)
email = models.EmailField(null=True, blank=True)
phone = models.CharField(max_length=255, null=True, blank=True)
def __str__(self):
return self.name
......@@ -39,14 +41,14 @@ def auto_increment_project_number():
class Project(Model):
name = models.CharField(max_length=255)
description = models.TextField(blank=True)
description = models.TextField(null=True, blank=True)
number = models.PositiveIntegerField(default=auto_increment_project_number, editable=False)
creationDate = models.DateField(auto_now_add=True)
customer = models.ForeignKey(Customer, on_delete=models.DO_NOTHING) # WARN add import
team = models.ManyToManyField(settings.AUTH_USER_MODEL, through='Member', blank=True)
captain = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.DO_NOTHING, blank=True, null=True,
related_name='+')
driveID = models.TextField(blank=True)
driveID = models.TextField(null=True, blank=True)
businessProvider = models.ForeignKey(BusinessProvider, blank=True, null=True, on_delete=models.DO_NOTHING)
jabberID = models.CharField(max_length=255, blank=True, null=True)
jabberRoom = models.BooleanField(default=True)
......@@ -67,7 +69,7 @@ class Project(Model):
class Member(Model):
project = models.ForeignKey(Project, on_delete=models.CASCADE, related_name='members')
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
name = models.CharField(max_length=255, blank=True)
name = models.CharField(max_length=255, null=True, blank=True)
is_admin = models.BooleanField(default=False)
class Meta:
......
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