diff --git a/bikeshop_project/bike/migrations/0003_auto_20170105_1405.py b/bikeshop_project/bike/migrations/0003_auto_20170105_1405.py new file mode 100644 index 0000000..3a930f9 --- /dev/null +++ b/bikeshop_project/bike/migrations/0003_auto_20170105_1405.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.4 on 2017-01-05 14:05 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('bike', '0002_auto_20170105_0238'), + ] + + operations = [ + migrations.AlterField( + model_name='bike', + name='size', + field=models.TextField(blank=True, choices=[('C', 'child'), ('M', 'medium'), ('L', 'large'), ('XL', 'extra large')], max_length=2, null=True), + ), + ] diff --git a/bikeshop_project/bike/models.py b/bikeshop_project/bike/models.py index afdb9e5..cf6aec7 100644 --- a/bikeshop_project/bike/models.py +++ b/bikeshop_project/bike/models.py @@ -52,7 +52,7 @@ class Bike(models.Model): colour = models.TextField(blank=False, null=False) make = models.TextField(blank=False, null=False) - size = models.TextField(choices=size_choices, max_length=2) + size = models.TextField(choices=size_choices, blank=True, null=True, max_length=2) serial_number = models.TextField(blank=False, null=False) source = models.TextField(blank=False, null=False, choices=source_choices) stripped = models.NullBooleanField() @@ -72,7 +72,7 @@ class Bike(models.Model): def can_assessed(self): return self.colour is not None and self.make is not None and self.size is not None and self.source is not None \ - and self.price is not None + and self.price is not None and self.size is not None def can_available(self): return self.stolen is not None and self.cpic_searched_at is not None and self.serial_number is not None