Skip to content

Commit

Permalink
allow to occupy plate positions, without samples
Browse files Browse the repository at this point in the history
  • Loading branch information
nicokant committed Dec 4, 2024
1 parent 2deb005 commit 6510761
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Generated by Django 5.1.3 on 2024-12-04 09:42

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("genlab_bestilling", "0010_remove_extractionplate_extracted_at_and_more"),
]

operations = [
migrations.AddField(
model_name="extractplateposition",
name="notes",
field=models.CharField(blank=True, null=True),
),
migrations.AlterField(
model_name="extractplateposition",
name="sample",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.PROTECT,
related_name="plate_positions",
to="genlab_bestilling.sample",
),
),
]
7 changes: 6 additions & 1 deletion src/genlab_bestilling/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,15 @@ class ExtractPlatePosition(models.Model):
"ExtractionPlate", on_delete=models.DO_NOTHING, related_name="sample_positions"
)
sample = models.ForeignKey(
"Sample", on_delete=models.PROTECT, related_name="plate_positions"
"Sample",
on_delete=models.PROTECT,
related_name="plate_positions",
null=True,
blank=True,
)
position = models.IntegerField()
extracted_at = models.DateTimeField(auto_now=True)
notes = models.CharField(null=True, blank=True)

# TODO: unique position per plate
class Meta:
Expand Down

0 comments on commit 6510761

Please sign in to comment.