@@ -2,13 +2,13 @@ # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. -# +# #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-05 13:41+0300\n" +"POT-Creation-Date: 2025-11-14 14:23+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -134,8 +134,8 @@ msgstr "Дочерний Бизнес Аккаунт" msgid "Child Business Accounts" msgstr "Дочерние Бизнес Аккаунты" -#: authentication/models/business_group.py:8 ml_model/models.py:17 -#: ml_model/models.py:37 ml_model/models.py:61 ml_model/models.py:269 +#: authentication/models/business_group.py:8 ml_model/models.py:18 +#: ml_model/models.py:38 ml_model/models.py:62 ml_model/models.py:269 #: payments/models/payment_plan.py:27 tools/chats/models.py:9 msgid "Title" msgstr "Название" @@ -162,7 +162,7 @@ msgid "Affiliated by" msgstr "Кем привлечена" #: authentication/models/business_host.py:36 authentication/models/user.py:138 -#: authentication/models/whitelist.py:16 ml_model/models.py:167 +#: authentication/models/whitelist.py:16 ml_model/models.py:168 #: payments/models/promocode.py:85 msgid "Is active" msgstr "Является активной" @@ -199,7 +199,7 @@ msgstr "ИНН" msgid "PSRN" msgstr "ОГРН" -#: authentication/models/business_host.py:69 ml_model/models.py:180 +#: authentication/models/business_host.py:69 ml_model/models.py:181 #: tools/public_api/models.py:30 msgid "Name" msgstr "Наименование" @@ -572,7 +572,12 @@ msgstr "Неверное имя пользователя" msgid "The file size cannot exceed %(max_mb_size)d MB" msgstr "Файл не может быть размером больше %(max_mb_size)d мегабайт" -#: ml_model/apps.py:9 ml_model/models.py:148 +#: ml_model/admin.py:136 +#, python-format +msgid "Version %(version)s already has input with the same type: %(type)s" +msgstr "Версия %(version)s уже имеет входные данные с таким же типом: %(type)s" + +#: ml_model/apps.py:9 ml_model/models.py:149 msgid "Neuron Models" msgstr "Нейронные Модели" @@ -628,145 +633,145 @@ msgstr "При рендеринге шаблона произошла неизв msgid "The neuron model does not exist" msgstr "Нейронная модель не существует" -#: ml_model/models.py:18 ml_model/models.py:38 ml_model/models.py:70 -#: ml_model/models.py:182 +#: ml_model/models.py:19 ml_model/models.py:39 ml_model/models.py:71 +#: ml_model/models.py:183 msgid "Slug" msgstr "Ярлык" -#: ml_model/models.py:28 ml_model/models.py:80 +#: ml_model/models.py:29 ml_model/models.py:81 msgid "Category" msgstr "Категория" -#: ml_model/models.py:29 +#: ml_model/models.py:30 msgid "Categories" msgstr "Категории" -#: ml_model/models.py:42 +#: ml_model/models.py:43 msgid "Not SVG-pictures not allowed" msgstr "Нельзя использовать не SVG-картинки" -#: ml_model/models.py:45 +#: ml_model/models.py:46 msgid "Icon" msgstr "Миниатюра" -#: ml_model/models.py:52 +#: ml_model/models.py:53 msgid "Model Tag" msgstr "Тег модели" -#: ml_model/models.py:53 +#: ml_model/models.py:54 msgid "Model Tags" msgstr "Теги модели" -#: ml_model/models.py:66 +#: ml_model/models.py:67 msgid "Alternative Titles" msgstr "Альтернативные названия" -#: ml_model/models.py:68 ml_model/models.py:181 ml_model/models.py:270 +#: ml_model/models.py:69 ml_model/models.py:182 ml_model/models.py:270 #: payments/models/payment.py:52 msgid "Description" msgstr "Описание" -#: ml_model/models.py:72 +#: ml_model/models.py:73 msgid "Fill automatically, don't touch" msgstr "Заполняется автоматически, не трогать" -#: ml_model/models.py:88 +#: ml_model/models.py:89 msgid "Avatar" msgstr "Аватар" -#: ml_model/models.py:91 +#: ml_model/models.py:92 msgid "Tags" msgstr "Теги" -#: ml_model/models.py:147 +#: ml_model/models.py:148 msgid "Neuron Model" msgstr "Нейронная Модель" -#: ml_model/models.py:156 ml_model/models.py:403 payments/admin.py:95 +#: ml_model/models.py:157 ml_model/models.py:403 payments/admin.py:95 msgid "Model" msgstr "Модель" -#: ml_model/models.py:172 ml_model/models.py:173 +#: ml_model/models.py:173 ml_model/models.py:174 msgid "Settings" msgstr "Настройки" -#: ml_model/models.py:176 +#: ml_model/models.py:177 #, python-format msgid "Settings of %(model_title)s" msgstr "Настройки %(model_title)s" -#: ml_model/models.py:195 +#: ml_model/models.py:196 #, python-format msgid "%(model_title)s | %(version_name)s" msgstr "%(model_title)s | %(version_name)s" -#: ml_model/models.py:201 +#: ml_model/models.py:202 msgid "Model Version" msgstr "Версия Модели" -#: ml_model/models.py:202 +#: ml_model/models.py:203 msgid "Model Versions" msgstr "Версии Модели" -#: ml_model/models.py:211 +#: ml_model/models.py:212 msgid "Versions" msgstr "Версии" -#: ml_model/models.py:212 +#: ml_model/models.py:213 msgid "Link to versions" msgstr "Привязка к версиям" -#: ml_model/models.py:221 reports/models/error_report.py:10 +#: ml_model/models.py:222 reports/models/error_report.py:10 msgid "Text" msgstr "Текст" -#: ml_model/models.py:222 +#: ml_model/models.py:223 msgid "Image" msgstr "Картинка" -#: ml_model/models.py:223 +#: ml_model/models.py:224 msgid "PDF" msgstr "PDF" -#: ml_model/models.py:224 +#: ml_model/models.py:225 msgid "DOCX" msgstr "DOCX" -#: ml_model/models.py:225 +#: ml_model/models.py:226 msgid "DOC" msgstr "DOC" -#: ml_model/models.py:226 +#: ml_model/models.py:227 msgid "Text File (Notebook)" msgstr "Текстовый файл (Блокнот)" -#: ml_model/models.py:227 +#: ml_model/models.py:228 msgid "ZIP Archive" msgstr "ZIP архив" -#: ml_model/models.py:228 +#: ml_model/models.py:229 msgid "Audio" msgstr "Аудио" -#: ml_model/models.py:234 ml_model/models.py:273 +#: ml_model/models.py:235 ml_model/models.py:273 #: payments/models/promocode.py:41 msgid "Type" msgstr "Тип" -#: ml_model/models.py:236 ml_model/models.py:284 +#: ml_model/models.py:237 ml_model/models.py:284 msgid "Required" msgstr "Обязательный" -#: ml_model/models.py:239 +#: ml_model/models.py:240 #, python-format msgid "%(model_title)s | %(input_type)s" msgstr "%(model_title)s | %(input_type)s" -#: ml_model/models.py:245 +#: ml_model/models.py:246 msgid "Model Input" msgstr "Модель" -#: ml_model/models.py:246 +#: ml_model/models.py:247 msgid "Model Inputs" msgstr "Входящий поток модели" @@ -935,7 +940,9 @@ msgstr "Невозможно получить данные модели" #: payments/admin.py:33 payments/admin.py:67 payments/admin.py:87 msgid "You can search by user email, exacted company name" -msgstr "Вы можете осуществлять поиск по e-mail пользователя, точному названию компании" +msgstr "" +"Вы можете осуществлять поиск по e-mail пользователя, точному названию " +"компании" #: payments/admin.py:38 payments/admin.py:92 msgid "Missing" @@ -0,0 +1,17 @@ +# Generated by Django 5.0.11 on 2025-11-14 10:09 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('ml_model', '0051_modelinstruction'), + ] + + operations = [ + migrations.AlterUniqueTogether( + name='modelinput', + unique_together=set(), + ), + ] @@ -1,5 +1,6 @@ from django.contrib import admin -from django.http.response import HttpResponse as HttpResponse +from django.core.exceptions import ValidationError +from django.utils.translation import gettext_lazy as _ from import_export.admin import ExportActionModelAdmin, ImportExportMixin from ordered_model.admin import ( OrderedInlineModelAdminMixin, @@ -123,6 +124,21 @@ class NeuronModelAdmin( return obj.category.title return 'Не присвоена' + def save_formset(self, request, form, formset, change): + if formset.model == ModelInput: + existed = set() + for input in formset.cleaned_data: + if input['DELETE']: + continue + for version in input['versions']: + if (pair := (version.pk, input['type'])) in existed: + raise ValidationError( + _('Version %(version)s already has input with the same type: %(type)s') + % {'version': version.name, 'type': _(input['type'].capitalize())} + ) + existed.add(pair) + super().save_formset(request, form, formset, change) + @admin.register(ModelTag) class ModelTagAdmin(ImportExportMixin, ExportActionModelAdmin, OrderedModelAdmin): @@ -244,7 +244,6 @@ class ModelInput(ModelDepends, ModelVersionsDepends): class Meta: verbose_name = _('Model Input') verbose_name_plural = _('Model Inputs') - unique_together = ('model', 'type') class ModelParameter(ModelDepends, ModelVersionsDepends, OrderedModel):