Tweak Collections Label
This commit is contained in:
parent
e361ba26e2
commit
f630cd9e11
3 changed files with 27 additions and 7 deletions
19
ccdb/locations/migrations/0003_study_location_code_req.py
Normal file
19
ccdb/locations/migrations/0003_study_location_code_req.py
Normal 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),
|
||||
),
|
||||
]
|
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue