Skip to content

Commit

Permalink
remove required on fields
Browse files Browse the repository at this point in the history
  • Loading branch information
nicokant committed Jun 21, 2024
1 parent 9eba3c4 commit 61b25ed
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/genlab_bestilling/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class EquipmentOrderAdmin(ModelAdmin):

class SampleInline(admin.StackedInline):
model = Sample
autocomplete_fields = ["species", "markers", "area", "location", "type"]
autocomplete_fields = ["species", "markers", "location", "type"]


@admin.register(AnalysisOrder)
Expand All @@ -152,4 +152,4 @@ class SampleAdmin(ModelAdmin):
search_fields = []
readonly_fields = ["order"]

autocomplete_fields = ["species", "markers", "area", "location", "type"]
autocomplete_fields = ["species", "markers", "location", "type"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Generated by Django 5.0.6 on 2024-06-21 11:58

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


class Migration(migrations.Migration):
dependencies = [
("genlab_bestilling", "0007_alter_order_status"),
]

operations = [
migrations.RemoveField(
model_name="sample",
name="area",
),
migrations.AlterField(
model_name="sample",
name="location",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.PROTECT,
to="genlab_bestilling.location",
),
),
migrations.AlterField(
model_name="sample",
name="notes",
field=models.TextField(blank=True, null=True),
),
]
8 changes: 5 additions & 3 deletions src/genlab_bestilling/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,12 @@ class Sample(models.Model):
species = models.ForeignKey("Species", on_delete=models.PROTECT)
markers = models.ManyToManyField("Marker")
date = models.DateField()
notes = models.TextField()
notes = models.TextField(null=True, blank=True)
pop_id = models.CharField(max_length=150)
area = models.ForeignKey("Area", on_delete=models.PROTECT)
location = models.ForeignKey("Location", on_delete=models.PROTECT)
# area = models.ForeignKey("Area", on_delete=models.PROTECT)
location = models.ForeignKey(
"Location", on_delete=models.PROTECT, null=True, blank=True
)
volume = models.FloatField(null=True, blank=True)

# plate
Expand Down

0 comments on commit 61b25ed

Please sign in to comment.