-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
726 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
147 changes: 147 additions & 0 deletions
147
...nlab_bestilling/migrations/0007_analysis_extractionplate_extractplateposition_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
# Generated by Django 5.1.1 on 2024-12-02 08:36 | ||
|
||
import django.db.models.deletion | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
( | ||
"genlab_bestilling", | ||
"0006_genrequest_created_at_genrequest_last_modified_at_and_more", | ||
), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="Analysis", | ||
fields=[ | ||
( | ||
"id", | ||
models.BigAutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("name", models.CharField()), | ||
("created_at", models.DateTimeField(auto_now_add=True)), | ||
("last_modified_at", models.DateTimeField(auto_now=True)), | ||
("analysis_date", models.DateTimeField(blank=True, null=True)), | ||
("result_file", models.FileField(blank=True, null=True, upload_to="")), | ||
("extra", models.JSONField(blank=True, null=True)), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name="ExtractionPlate", | ||
fields=[ | ||
( | ||
"id", | ||
models.BigAutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("name", models.CharField()), | ||
("created_at", models.DateTimeField(auto_now_add=True)), | ||
("last_modified_at", models.DateTimeField(auto_now=True)), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name="ExtractPlatePosition", | ||
fields=[ | ||
( | ||
"id", | ||
models.BigAutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("position", models.IntegerField()), | ||
], | ||
), | ||
migrations.AddField( | ||
model_name="sample", | ||
name="desired_extractions", | ||
field=models.IntegerField(default=1), | ||
), | ||
migrations.AddField( | ||
model_name="sample", | ||
name="genlab_id", | ||
field=models.CharField(blank=True, null=True), | ||
), | ||
migrations.AddField( | ||
model_name="sample", | ||
name="parent", | ||
field=models.ForeignKey( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.PROTECT, | ||
to="genlab_bestilling.sample", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="sample", | ||
name="replica_number", | ||
field=models.IntegerField(blank=True, null=True), | ||
), | ||
migrations.AddField( | ||
model_name="sample", | ||
name="running_number", | ||
field=models.IntegerField(blank=True, null=True), | ||
), | ||
migrations.AddField( | ||
model_name="species", | ||
name="code", | ||
field=models.CharField(blank=True, null=True), | ||
), | ||
migrations.AddConstraint( | ||
model_name="species", | ||
constraint=models.UniqueConstraint( | ||
fields=("code",), name="unique species code" | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="analysis", | ||
name="marker", | ||
field=models.ForeignKey( | ||
on_delete=django.db.models.deletion.DO_NOTHING, | ||
to="genlab_bestilling.marker", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="analysis", | ||
name="samples", | ||
field=models.ManyToManyField(blank=True, to="genlab_bestilling.sample"), | ||
), | ||
migrations.AddField( | ||
model_name="sample", | ||
name="extractions", | ||
field=models.ManyToManyField( | ||
blank=True, to="genlab_bestilling.extractionplate" | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="extractplateposition", | ||
name="plate", | ||
field=models.ForeignKey( | ||
on_delete=django.db.models.deletion.DO_NOTHING, | ||
related_name="sample_positions", | ||
to="genlab_bestilling.extractionplate", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="extractplateposition", | ||
name="sample", | ||
field=models.ForeignKey( | ||
on_delete=django.db.models.deletion.PROTECT, | ||
related_name="plate_positions", | ||
to="genlab_bestilling.sample", | ||
), | ||
), | ||
] |
30 changes: 30 additions & 0 deletions
30
src/genlab_bestilling/migrations/0008_alter_order_status.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Generated by Django 5.1.1 on 2024-12-02 09:44 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
( | ||
"genlab_bestilling", | ||
"0007_analysis_extractionplate_extractplateposition_and_more", | ||
), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="order", | ||
name="status", | ||
field=models.CharField( | ||
choices=[ | ||
("draft", "Draft"), | ||
("confirmed", "Confirmed"), | ||
("processing", "Processing"), | ||
("completed", "Completed"), | ||
("checked", "Checked"), | ||
("extracted", "Extracted"), | ||
], | ||
default="draft", | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from typing import Self | ||
|
||
from django.apps import AppConfig as DjangoAppConfig | ||
from django.utils.translation import gettext_lazy as _ | ||
|
||
|
||
class AppConfig(DjangoAppConfig): | ||
name = "genlab_bestilling.staff" | ||
verbose_name = _("GenLab staff") | ||
|
||
def ready(self: Self) -> None: | ||
try: | ||
import genlab_bestilling.signals # noqa: F401 | ||
except ImportError: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import django_filters as filters | ||
|
||
from ..models import AnalysisOrder, Sample | ||
|
||
|
||
class AnalysisOrderFilter(filters.FilterSet): | ||
class Meta: | ||
model = AnalysisOrder | ||
fields = [ | ||
"id", | ||
"status", | ||
"genrequest", | ||
"genrequest__project", | ||
] | ||
|
||
|
||
class SampleFilter(filters.FilterSet): | ||
class Meta: | ||
model = Sample | ||
fields = [ | ||
"order", | ||
"guid", | ||
"name", | ||
"genlab_id", | ||
"species", | ||
"type", | ||
"year", | ||
"location", | ||
"pop_id", | ||
"type", | ||
"desired_extractions", | ||
] |
Empty file.
Oops, something went wrong.