Skip to content

Commit

Permalink
8694uffy4: a very simple ordering integer can now be applies to each …
Browse files Browse the repository at this point in the history
…meta task and each meta task value
  • Loading branch information
tomolopolis committed Jul 10, 2024
1 parent 56d59c7 commit e5da396
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Generated by Django 5.0.6 on 2024-07-10 16:09

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('api', '0079_merge_20240701_2259'),
]

operations = [
migrations.AlterModelOptions(
name='metatask',
options={'ordering': ['ordering', 'name']},
),
migrations.AlterModelOptions(
name='metataskvalue',
options={'ordering': ['ordering', 'name']},
),
migrations.AddField(
model_name='metatask',
name='ordering',
field=models.PositiveSmallIntegerField(default=0, help_text='the order in which the meta task will appear in the Trainer Annotation project screen'),
),
migrations.AddField(
model_name='metataskvalue',
name='ordering',
field=models.PositiveSmallIntegerField(default=0, help_text='the order in which the meta task value will appear in the Trainer Annotation project screen'),
),
]
10 changes: 10 additions & 0 deletions webapp/api/api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,11 @@ def __str__(self):

class MetaTaskValue(models.Model):
name = models.CharField(max_length=150)
ordering = models.PositiveSmallIntegerField(help_text="the order in which the meta task value will appear in "
"the Trainer Annotation project screen", default=0)

class Meta:
ordering = ['ordering', 'name']

def __str__(self):
return str(self.name)
Expand All @@ -346,6 +351,11 @@ class MetaTask(models.Model):
values = models.ManyToManyField(MetaTaskValue, related_name='values')
default = models.ForeignKey('MetaTaskValue', null=True, blank=True, on_delete=models.SET_NULL)
description = models.TextField(default="", blank=True)
ordering = models.PositiveSmallIntegerField(help_text="the order in which the meta task will appear in "
"the Trainer Annotation project screen", default=0)

class Meta:
ordering = ['ordering', 'name']

def __str__(self):
return str(self.name)
Expand Down

0 comments on commit e5da396

Please sign in to comment.