diff --git a/directory/models.py b/directory/models.py index 785c449862..dcd357ee74 100644 --- a/directory/models.py +++ b/directory/models.py @@ -63,8 +63,8 @@ def get_or_create_relation(relation_data): @staticmethod def get_all_relation(): - relations = ReleationsFT.objects.all() - data = [{"id": i.pk, "label": f"{i.tube.title}-({i.pk})"} for i in relations] + relations = ReleationsFT.objects.all().select_related('tube').order_by('tube__title') + data = [{"id": i.pk, "label": f"{i.tube.title} ({i.pk})", "color": i.tube.color} for i in relations] return data diff --git a/l2-frontend/src/construct/FractionsGroup.vue b/l2-frontend/src/construct/FractionsGroup.vue index da6a5d7e74..4cf88d5ac4 100644 --- a/l2-frontend/src/construct/FractionsGroup.vue +++ b/l2-frontend/src/construct/FractionsGroup.vue @@ -22,7 +22,26 @@ :multiple="false" class="treeselect-wide treeselect-26px" placeholder="Выберите пробирку" - /> + > +
+ +
+
+ +
+ diff --git a/researches/models.py b/researches/models.py index f18dd3faf0..9ed4539f21 100644 --- a/researches/models.py +++ b/researches/models.py @@ -69,7 +69,7 @@ def get_all(pk_in_title=False): "label": tube.title if not pk_in_title else f"{tube.title} ({tube.pk})", "color": tube.color, } - for tube in Tubes.objects.all() + for tube in Tubes.objects.all().order_by("title") ] return result