From 9cd4b8afca81ec5a0812b1f6cbf278c7011bfc91 Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Thu, 2 Jun 2016 13:21:24 -0700 Subject: [PATCH] Remove null=True from a few fields django check pointed out that null=True is confusing with blank or ManyToMany fields. --- samples/migrations/0001_initial.py | 6 +++--- samples/models.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/samples/migrations/0001_initial.py b/samples/migrations/0001_initial.py index 893fc1f..11b43e8 100644 --- a/samples/migrations/0001_initial.py +++ b/samples/migrations/0001_initial.py @@ -111,7 +111,7 @@ class Migration(migrations.Migration): ('bioanalyzer_summary', models.TextField(default='', blank=True)), ('bioanalyzer_concentration', models.DecimalField(help_text='(ng/\xb5l)', null=True, max_digits=5, decimal_places=2, blank=True)), ('bioanalyzer_image_url', models.URLField(default='', blank=True)), - ('affiliations', models.ManyToManyField(related_name='library_affiliations', null=True, to='samples.Affiliation')), + ('affiliations', models.ManyToManyField(related_name='library_affiliations', to='samples.Affiliation')), ('amplified_from_sample', models.ForeignKey(related_name='amplified_into_sample', blank=True, to='samples.Library', null=True)), ('antibody', models.ForeignKey(blank=True, to='samples.Antibody', null=True)), ('cell_line', models.ForeignKey(verbose_name='Background', blank=True, to='samples.Cellline', null=True)), @@ -194,13 +194,13 @@ class Migration(migrations.Migration): migrations.AddField( model_name='library', name='tags', - field=models.ManyToManyField(related_name='library_tags', null=True, to='samples.Tag', blank=True), + field=models.ManyToManyField(related_name='library_tags', to='samples.Tag', blank=True), preserve_default=True, ), migrations.AddField( model_name='affiliation', name='users', - field=models.ManyToManyField(to='samples.HTSUser', null=True, blank=True), + field=models.ManyToManyField(to='samples.HTSUser', blank=True), preserve_default=True, ), migrations.AlterUniqueTogether( diff --git a/samples/models.py b/samples/models.py index c912f4a..acf66e9 100644 --- a/samples/models.py +++ b/samples/models.py @@ -173,7 +173,7 @@ class Affiliation(models.Model): contact = models.CharField(max_length=256, null=True, blank=True, verbose_name='Lab Name') email = models.EmailField(null=True, blank=True) - users = models.ManyToManyField('HTSUser', null=True, blank=True) + users = models.ManyToManyField('HTSUser', blank=True) users.admin_order_field = "username" def __str__(self): @@ -230,9 +230,9 @@ class Library(models.Model): condition = models.ForeignKey(Condition, blank=True, null=True) antibody = models.ForeignKey(Antibody, blank=True, null=True) affiliations = models.ManyToManyField( - Affiliation, related_name='library_affiliations', null=True) + Affiliation, related_name='library_affiliations') tags = models.ManyToManyField(Tag, related_name='library_tags', - blank=True, null=True) + blank=True) REPLICATE_NUM = [(x, x) for x in range(1, 7)] replicate = models.PositiveSmallIntegerField(choices=REPLICATE_NUM, blank=True, null=True) -- 2.30.2