Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Allow NULLable fields to be blank #62

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions dreamjub/migrations/0004_auto_20171029_1427.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-10-29 14:27
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('dreamjub', '0003_auto_20161204_2258'),
]

operations = [
migrations.AlterField(
model_name='student',
name='building',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AlterField(
model_name='student',
name='college',
field=models.CharField(blank=True, choices=[('Krupp', 'Krupp College'), ('Mercator', 'Mercator College'), ('C3', 'College III'), ('Nordmetall', 'College Nordmetall')], max_length=255, null=True),
),
migrations.AlterField(
model_name='student',
name='country',
field=models.TextField(blank=True, null=True),
),
migrations.AlterField(
model_name='student',
name='degree',
field=models.CharField(blank=True, choices=[('Bachelor of Science', 'Bachelor of Science'), ('Bachelor of Art', 'Bachelor of Art'), ('Master of Science', 'Master of Science'), ('Master of Art', 'Master of Art'), ('PhD', 'PhD')], max_length=255, null=True),
),
migrations.AlterField(
model_name='student',
name='majorShort',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AlterField(
model_name='student',
name='picture',
field=models.ImageField(blank=True, null=True, upload_to='faces/%Y/%m/%d/'),
),
migrations.AlterField(
model_name='student',
name='status',
field=models.CharField(blank=True, choices=[('foundation-year', 'Foundation Year'), ('medprep', 'Medprep'), ('undergrad', 'Undergraduate'), ('master', 'Master'), ('phd-integrated', 'integrated PhD'), ('phd', 'PhD'), ('winter', 'Winter School Student'), ('guest', 'Guest Student')], max_length=255, null=True),
),
migrations.AlterField(
model_name='student',
name='year',
field=models.PositiveIntegerField(blank=True, null=True),
),
]
17 changes: 9 additions & 8 deletions dreamjub/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ def fullName(self):
return '%s %s' % (self.firstName, self.lastName)

# Colorfoul Info
country = models.TextField(null=True) #: Country of origin
picture = models.ImageField(null=True, upload_to='faces/%Y/%m/%d/') #:
country = models.TextField(blank=True, null=True) #: Country of origin
picture = models.ImageField(blank=True, null=True,
upload_to='faces/%Y/%m/%d/') #:
# Picture (if available)

# College Contact Info
Expand All @@ -44,13 +45,13 @@ def fullName(self):
(MERCATOR, 'Mercator College'),
(COLLEGE_III, 'College III'),
(COLLEGE_NORDMETALL, 'College Nordmetall')
), null=True, max_length=255)
), blank=True, null=True, max_length=255)

# Physical contact information
phone = models.TextField(blank=True, null=True)
isCampusPhone = models.BooleanField(default=False)
room = models.TextField(blank=True, null=True)
building = models.CharField(null=True, max_length=255)
building = models.CharField(blank=True, null=True, max_length=255)

# Types of people
isStudent = models.BooleanField()
Expand All @@ -77,7 +78,7 @@ def fullName(self):

(WINTER, 'Winter School Student'),
(GUEST, 'Guest Student')
), null=True, max_length=255) #: current student status
), blank=True, null=True, max_length=255) #: current student status

#: Degree Status
BACHELOR_OF_SCIENCE = 'Bachelor of Science'
Expand All @@ -93,12 +94,12 @@ def fullName(self):
(MASTER_OF_ART, 'Master of Art'),

(PHD_DEGREE, 'PhD')
), null=True, max_length=255)
), blank=True, null=True, max_length=255)

# year and major
year = models.PositiveIntegerField(
null=True) #: (Last known) year of Graduation
majorShort = models.CharField(null=True, max_length=255)
blank=True, null=True) #: (Last known) year of Graduation
majorShort = models.CharField(blank=True, null=True, max_length=255)

# TODO: Fill this
MAJOR_NAMES_MAP = {
Expand Down