Skip to content
This repository has been archived by the owner on Jul 18, 2023. It is now read-only.

Commit

Permalink
Split Extractions and Batches, change several model fields and relations
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronstephenson committed Sep 27, 2017
1 parent c73b859 commit fef4d64
Show file tree
Hide file tree
Showing 7 changed files with 235 additions and 185 deletions.
2 changes: 1 addition & 1 deletion lideservices/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
admin.site.register(SampleAnalysisBatch, SimpleHistoryAdmin)
admin.site.register(AnalysisBatch, SimpleHistoryAdmin)
admin.site.register(Extraction, SimpleHistoryAdmin)
admin.site.register(ExtractionInhibition, SimpleHistoryAdmin)
admin.site.register(ExtractionBatch, SimpleHistoryAdmin)
admin.site.register(Inhibition, SimpleHistoryAdmin)
admin.site.register(ReverseTranscription, SimpleHistoryAdmin)
admin.site.register(PCRReplicate, SimpleHistoryAdmin)
Expand Down
100 changes: 64 additions & 36 deletions lideservices/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-09-21 14:44
# Generated by Django 1.11.2 on 2017-09-27 12:32
from __future__ import unicode_literals

import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import enumchoicefield.fields
import lideservices.models


class Migration(migrations.Migration):
Expand Down Expand Up @@ -113,28 +115,28 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)),
('modified_date', models.DateField(auto_now=True, null=True)),
('extraction_number', models.IntegerField(unique=True)),
('extraction_volume', models.FloatField(blank=True, null=True)),
('elution_volume', models.FloatField(blank=True, null=True)),
('extraction_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)),
('analysis_batch', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='extractions', to='lideservices.AnalysisBatch')),
('dilution_factor', models.IntegerField(blank=True, null=True)),
('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='extraction_creator', to=settings.AUTH_USER_MODEL)),
],
options={
'db_table': 'lide_extraction',
},
),
migrations.CreateModel(
name='ExtractionInhibition',
name='ExtractionBatch',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)),
('modified_date', models.DateField(auto_now=True, null=True)),
('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='extractioninhibition_creator', to=settings.AUTH_USER_MODEL)),
('extraction', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='lideservices.Extraction')),
('extraction_number', models.IntegerField()),
('extraction_volume', models.FloatField(blank=True, null=True)),
('elution_volume', models.FloatField(blank=True, null=True)),
('extraction_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)),
('analysis_batch', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='extractionbatches', to='lideservices.AnalysisBatch')),
('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='extractionbatch_creator', to=settings.AUTH_USER_MODEL)),
],
options={
'db_table': 'lide_extractioninhibition',
'db_table': 'lide_extractionbatch',
},
),
migrations.CreateModel(
Expand Down Expand Up @@ -223,11 +225,10 @@ class Migration(migrations.Migration):
('modified_date', models.DateField(auto_now=True, null=True)),
('name', models.CharField(max_length=128, unique=True)),
('inhibition_number', models.IntegerField(unique=True)),
('type', models.CharField(blank=True, max_length=128, null=True)),
('dilution', models.FloatField(blank=True, null=True)),
('type', enumchoicefield.fields.EnumChoiceField(default=lideservices.models.NucleicAcidType(1), enum_class=lideservices.models.NucleicAcidType, max_length=3)),
('dilution_factor', models.IntegerField(blank=True, null=True)),
('inhibition_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)),
('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='inhibition_creator', to=settings.AUTH_USER_MODEL)),
('extraction', models.ManyToManyField(related_name='inhibitions', through='lideservices.ExtractionInhibition', to='lideservices.Extraction')),
('modified_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='inhibition_modifier', to=settings.AUTH_USER_MODEL)),
],
options={
Expand All @@ -249,6 +250,20 @@ class Migration(migrations.Migration):
'db_table': 'lide_matrixtype',
},
),
migrations.CreateModel(
name='Medium',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)),
('modified_date', models.DateField(auto_now=True, null=True)),
('name', models.CharField(max_length=128, unique=True)),
('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='medium_creator', to=settings.AUTH_USER_MODEL)),
('modified_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='medium_modifier', to=settings.AUTH_USER_MODEL)),
],
options={
'db_table': 'lide_medium',
},
),
migrations.CreateModel(
name='OtherAnalysis',
fields=[
Expand All @@ -270,10 +285,14 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)),
('modified_date', models.DateField(auto_now=True, null=True)),
('replicate', models.IntegerField()),
('cycle_of_quantification', models.FloatField(blank=True, null=True)),
('guanine_cytosine_content_reaction', models.FloatField(blank=True, null=True)),
('replicate_number', models.IntegerField()),
('cq_value', models.FloatField(blank=True, null=True)),
('gc_reaction', models.FloatField(blank=True, null=True)),
('concentration', models.FloatField(blank=True, null=True)),
('sample_mean_concentration', models.FloatField(blank=True, null=True)),
('bad_result_flag', models.BooleanField(default=False)),
('pcr_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)),
('template_volume', models.FloatField(blank=True, null=True)),
],
options={
'db_table': 'lide_pcrreplicate',
Expand All @@ -287,9 +306,9 @@ class Migration(migrations.Migration):
('modified_date', models.DateField(auto_now=True, null=True)),
('name', models.CharField(max_length=128, unique=True)),
('rt_number', models.IntegerField(unique=True)),
('volume_in', models.FloatField(blank=True, null=True)),
('volume_out', models.FloatField(blank=True, null=True)),
('cycle_of_quantification', models.FloatField(blank=True, null=True)),
('template_volume', models.FloatField(blank=True, null=True)),
('reaction_volume', models.FloatField(blank=True, null=True)),
('cq_value', models.FloatField(blank=True, null=True)),
('rt_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)),
('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='reversetranscription_creator', to=settings.AUTH_USER_MODEL)),
('extraction', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reverse_transcriptions', to='lideservices.Extraction')),
Expand Down Expand Up @@ -433,9 +452,10 @@ class Migration(migrations.Migration):
('created_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)),
('modified_date', models.DateField(auto_now=True, null=True)),
('name', models.CharField(max_length=128, unique=True)),
('abbreviation', models.CharField(blank=True, max_length=128, null=True)),
('type', models.CharField(blank=True, max_length=128, null=True)),
('code', models.CharField(blank=True, max_length=128, null=True)),
('type', enumchoicefield.fields.EnumChoiceField(default=lideservices.models.NucleicAcidType(1), enum_class=lideservices.models.NucleicAcidType, max_length=3)),
('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='target_creator', to=settings.AUTH_USER_MODEL)),
('medium', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='targets', to='lideservices.Medium')),
('modified_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='target_modifier', to=settings.AUTH_USER_MODEL)),
],
options={
Expand Down Expand Up @@ -527,11 +547,6 @@ class Migration(migrations.Migration):
name='extraction',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='pcrreplicates', to='lideservices.Extraction'),
),
migrations.AddField(
model_name='pcrreplicate',
name='inhibition',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='pcrreplicates', to='lideservices.Inhibition'),
),
migrations.AddField(
model_name='pcrreplicate',
name='modified_by',
Expand All @@ -547,6 +562,11 @@ class Migration(migrations.Migration):
name='target',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='pcrreplicates', to='lideservices.Target'),
),
migrations.AddField(
model_name='inhibition',
name='sample',
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='inhibitions', to='lideservices.Sample'),
),
migrations.AddField(
model_name='finalconcentratedsamplevolume',
name='sample',
Expand All @@ -563,24 +583,24 @@ class Migration(migrations.Migration):
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='filtertype_modifier', to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='extractioninhibition',
name='inhibition',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='lideservices.Inhibition'),
model_name='extractionbatch',
name='extraction_method',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='extractionbatches', to='lideservices.ExtractionMethod'),
),
migrations.AddField(
model_name='extractioninhibition',
model_name='extractionbatch',
name='modified_by',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='extractioninhibition_modifier', to=settings.AUTH_USER_MODEL),
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='extractionbatch_modifier', to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='extraction',
name='extraction_method',
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='extractions', to='lideservices.ExtractionMethod'),
name='extraction_batch',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='extractions', to='lideservices.ExtractionBatch'),
),
migrations.AddField(
model_name='extraction',
name='inhibition',
field=models.ManyToManyField(related_name='extractioninhibitions', through='lideservices.ExtractionInhibition', to='lideservices.Inhibition'),
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='extractions', to='lideservices.Inhibition'),
),
migrations.AddField(
model_name='extraction',
Expand Down Expand Up @@ -646,8 +666,16 @@ class Migration(migrations.Migration):
unique_together=set([('sample', 'analysis_batch')]),
),
migrations.AlterUniqueTogether(
name='extractioninhibition',
unique_together=set([('extraction', 'inhibition')]),
name='reversetranscription',
unique_together=set([('extraction', 'rt_number')]),
),
migrations.AlterUniqueTogether(
name='inhibition',
unique_together=set([('sample', 'inhibition_number')]),
),
migrations.AlterUniqueTogether(
name='extractionbatch',
unique_together=set([('analysis_batch', 'extraction_number')]),
),
migrations.AlterUniqueTogether(
name='aliquot',
Expand Down
Loading

0 comments on commit fef4d64

Please sign in to comment.