diff --git a/edc_data_manager/migrations/0035_alter_datadictionary_options_alter_dataquery_options_and_more.py b/edc_data_manager/migrations/0035_alter_datadictionary_options_alter_dataquery_options_and_more.py new file mode 100644 index 0000000..73e573b --- /dev/null +++ b/edc_data_manager/migrations/0035_alter_datadictionary_options_alter_dataquery_options_and_more.py @@ -0,0 +1,223 @@ +# Generated by Django 4.2.7 on 2023-12-03 00:22 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("edc_data_manager", "0034_issue"), + ] + + operations = [ + migrations.AlterModelOptions( + name="datadictionary", + options={ + "default_permissions": ("view", "export"), + "verbose_name": "Data Dictionary Item", + "verbose_name_plural": "Data Dictionary Items", + }, + ), + migrations.AlterModelOptions( + name="dataquery", + options={ + "default_manager_name": "objects", + "default_permissions": ( + "add", + "change", + "delete", + "view", + "export", + "import", + ), + "verbose_name": "Data Query", + "verbose_name_plural": "Data Queries", + }, + ), + migrations.AlterModelOptions( + name="queryrule", + options={ + "default_manager_name": "objects", + "default_permissions": ( + "add", + "change", + "delete", + "view", + "export", + "import", + ), + "verbose_name": "Query Rule", + "verbose_name_plural": "Query Rules", + }, + ), + migrations.AddField( + model_name="datadictionary", + name="locale_created", + field=models.CharField( + blank=True, + help_text="Auto-updated by Modeladmin", + max_length=10, + null=True, + verbose_name="Locale created", + ), + ), + migrations.AddField( + model_name="datadictionary", + name="locale_modified", + field=models.CharField( + blank=True, + help_text="Auto-updated by Modeladmin", + max_length=10, + null=True, + verbose_name="Locale modified", + ), + ), + migrations.AddField( + model_name="dataquery", + name="locale_created", + field=models.CharField( + blank=True, + help_text="Auto-updated by Modeladmin", + max_length=10, + null=True, + verbose_name="Locale created", + ), + ), + migrations.AddField( + model_name="dataquery", + name="locale_modified", + field=models.CharField( + blank=True, + help_text="Auto-updated by Modeladmin", + max_length=10, + null=True, + verbose_name="Locale modified", + ), + ), + migrations.AddField( + model_name="edcpermissions", + name="locale_created", + field=models.CharField( + blank=True, + help_text="Auto-updated by Modeladmin", + max_length=10, + null=True, + verbose_name="Locale created", + ), + ), + migrations.AddField( + model_name="edcpermissions", + name="locale_modified", + field=models.CharField( + blank=True, + help_text="Auto-updated by Modeladmin", + max_length=10, + null=True, + verbose_name="Locale modified", + ), + ), + migrations.AddField( + model_name="historicaldatadictionary", + name="locale_created", + field=models.CharField( + blank=True, + help_text="Auto-updated by Modeladmin", + max_length=10, + null=True, + verbose_name="Locale created", + ), + ), + migrations.AddField( + model_name="historicaldatadictionary", + name="locale_modified", + field=models.CharField( + blank=True, + help_text="Auto-updated by Modeladmin", + max_length=10, + null=True, + verbose_name="Locale modified", + ), + ), + migrations.AddField( + model_name="historicaldataquery", + name="locale_created", + field=models.CharField( + blank=True, + help_text="Auto-updated by Modeladmin", + max_length=10, + null=True, + verbose_name="Locale created", + ), + ), + migrations.AddField( + model_name="historicaldataquery", + name="locale_modified", + field=models.CharField( + blank=True, + help_text="Auto-updated by Modeladmin", + max_length=10, + null=True, + verbose_name="Locale modified", + ), + ), + migrations.AddField( + model_name="historicalqueryrule", + name="locale_created", + field=models.CharField( + blank=True, + help_text="Auto-updated by Modeladmin", + max_length=10, + null=True, + verbose_name="Locale created", + ), + ), + migrations.AddField( + model_name="historicalqueryrule", + name="locale_modified", + field=models.CharField( + blank=True, + help_text="Auto-updated by Modeladmin", + max_length=10, + null=True, + verbose_name="Locale modified", + ), + ), + migrations.AddField( + model_name="queryrule", + name="locale_created", + field=models.CharField( + blank=True, + help_text="Auto-updated by Modeladmin", + max_length=10, + null=True, + verbose_name="Locale created", + ), + ), + migrations.AddField( + model_name="queryrule", + name="locale_modified", + field=models.CharField( + blank=True, + help_text="Auto-updated by Modeladmin", + max_length=10, + null=True, + verbose_name="Locale modified", + ), + ), + migrations.AlterField( + model_name="datadictionary", + name="prompt", + field=models.CharField(max_length=500), + ), + migrations.AlterField( + model_name="historicaldatadictionary", + name="prompt", + field=models.CharField(max_length=500), + ), + migrations.AddIndex( + model_name="datadictionary", + index=models.Index( + fields=["model", "number", "prompt"], + name="edc_data_ma_model_92b469_idx", + ), + ), + ] diff --git a/edc_data_manager/models/data_dictionary.py b/edc_data_manager/models/data_dictionary.py index e353e45..9e0fe65 100644 --- a/edc_data_manager/models/data_dictionary.py +++ b/edc_data_manager/models/data_dictionary.py @@ -1,5 +1,6 @@ from django.apps import apps as django_apps from django.db import models +from django.db.models import Index from edc_model.models import BaseUuidModel, HistoricalRecords @@ -15,7 +16,7 @@ class DataDictionary(BaseUuidModel): number = models.IntegerField() - prompt = models.TextField() + prompt = models.CharField(max_length=500) field_name = models.CharField(max_length=250) @@ -64,8 +65,8 @@ def model_cls(self): return django_apps.get_model(self.model) class Meta: - default_permissions = ("view", "export") - ordering = ("model", "number", "prompt") - unique_together = (("model", "field_name"),) verbose_name = "Data Dictionary Item" verbose_name_plural = "Data Dictionary Items" + default_permissions = ("view", "export") + unique_together = (("model", "field_name"),) + indexes = [Index(fields=["model", "number", "prompt"])] diff --git a/edc_data_manager/models/query_rule.py b/edc_data_manager/models/query_rule.py index 4558d64..c9623a9 100644 --- a/edc_data_manager/models/query_rule.py +++ b/edc_data_manager/models/query_rule.py @@ -239,7 +239,6 @@ def model_cls(self): return django_apps.get_model(dct_models[0]) class Meta(BaseUuidModel.Meta): - ordering = ("title",) verbose_name = "Query Rule" verbose_name_plural = "Query Rules" indexes = [models.Index(fields=["title", "active"])] diff --git a/runtests.py b/runtests.py index 674475b..7470085 100644 --- a/runtests.py +++ b/runtests.py @@ -53,6 +53,7 @@ "edc_device.apps.AppConfig", "edc_identifier.apps.AppConfig", "edc_facility.apps.AppConfig", + "edc_form_runners.apps.AppConfig", "edc_lab.apps.AppConfig", "edc_list_data.apps.AppConfig", "edc_listboard.apps.AppConfig",