Tweak Collections Label

This commit is contained in:
Matthew Ryan Dillon 2016-02-03 11:45:29 -07:00
parent e361ba26e2
commit f630cd9e11
3 changed files with 27 additions and 7 deletions

View file

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('locations', '0002_remove_site_fk_dupes'),
]
operations = [
migrations.AlterField(
model_name='studylocation',
name='code',
field=models.CharField(max_length=10),
),
]

View file

@ -50,7 +50,7 @@ class MunicipalLocation(models.Model):
class StudyLocation(models.Model):
site = models.ForeignKey(Site)
name = models.CharField(max_length=100)
code = models.CharField(max_length=10, blank=True)
code = models.CharField(max_length=10)
study_location_type = models.CharField(max_length=50, blank=True)
treatment_type = models.CharField(max_length=100, blank=True)
municipal_location = models.ForeignKey(MunicipalLocation,
@ -61,7 +61,7 @@ class StudyLocation(models.Model):
slug = AutoSlugField(populate_from='name')
def __str__(self):
return self.name
return self.code
class Meta:
unique_together = ('site', 'name')