From 571c1fde0d3d64645ae21006838f845f79bad58c Mon Sep 17 00:00:00 2001 From: Corinne Kinzy Date: Thu, 18 Aug 2022 10:35:55 -0400 Subject: [PATCH 1/5] update display_name on FieldSchema --- .../migrations/0006_auto_20220818_1425.py | 18 ++++++++++++++++++ data_schema/models.py | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 data_schema/migrations/0006_auto_20220818_1425.py diff --git a/data_schema/migrations/0006_auto_20220818_1425.py b/data_schema/migrations/0006_auto_20220818_1425.py new file mode 100644 index 0000000..4dfdfab --- /dev/null +++ b/data_schema/migrations/0006_auto_20220818_1425.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.28 on 2022-08-18 14:25 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('data_schema', '0005_auto_20180302_2356'), + ] + + operations = [ + migrations.AlterField( + model_name='fieldschema', + name='display_name', + field=models.TextField(blank=True, default=''), + ), + ] diff --git a/data_schema/models.py b/data_schema/models.py index 27214f9..6d0795c 100644 --- a/data_schema/models.py +++ b/data_schema/models.py @@ -159,7 +159,7 @@ def __str__(self): field_key = models.CharField(max_length=255) # Optional way to display the field. defaults to the field_key - display_name = models.CharField(max_length=64, blank=True, default='') + display_name = models.TextField(blank=True, default='') # The order in which this field appears in the UID for the record. It is null if it does # not appear in the uniqueness constraint From b11350f6004f81a783ba55f39ffcac0c731157bb Mon Sep 17 00:00:00 2001 From: Corinne Kinzy Date: Thu, 18 Aug 2022 11:30:56 -0400 Subject: [PATCH 2/5] bump version --- data_schema/docs/release_notes.rst | 3 +++ data_schema/version.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/data_schema/docs/release_notes.rst b/data_schema/docs/release_notes.rst index cc0f849..2576533 100644 --- a/data_schema/docs/release_notes.rst +++ b/data_schema/docs/release_notes.rst @@ -1,5 +1,8 @@ Release Notes +v1.4.1 +------ +* Update display_name field on FieldSchema to no longer have a char limit. v1.4.0 ------ diff --git a/data_schema/version.py b/data_schema/version.py index 96e3ce8..8e3c933 100644 --- a/data_schema/version.py +++ b/data_schema/version.py @@ -1 +1 @@ -__version__ = '1.4.0' +__version__ = '1.4.1' From c2df4a60557e32cdd7078ab8c8d8bac1d4c79a5f Mon Sep 17 00:00:00 2001 From: Corinne Kinzy Date: Thu, 18 Aug 2022 12:31:33 -0400 Subject: [PATCH 3/5] add test --- data_schema/tests/model_tests.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/data_schema/tests/model_tests.py b/data_schema/tests/model_tests.py index a366dc9..8883a50 100644 --- a/data_schema/tests/model_tests.py +++ b/data_schema/tests/model_tests.py @@ -1,6 +1,7 @@ from django.test import TestCase +from django_dynamic_fixture import G -from data_schema.models import FieldSchema +from data_schema.models import FieldSchema, DataSchema class FieldSchemaTest(TestCase): @@ -9,3 +10,17 @@ def test_unicode(self): field = FieldSchema(field_key='key', display_name='Field', id=10) self.assertEqual(str(field), u'10 - key - Field') + + def test_display_name_no_character_limit(self): + data_schema = G(DataSchema) + field_schema = FieldSchema( + data_schema=data_schema, + field_key='testing_id', + display_name='Testing this is longer than 64 characters and we are no longer failing') + + field_schema.save() + + self.assertEqual( + field_schema.display_name, + 'Testing this is longer than 64 characters and we are no longer failing' + ) From a7cd69443e9177bcb3ed7e6e37bb861f9f3234bc Mon Sep 17 00:00:00 2001 From: Corinne Kinzy Date: Thu, 18 Aug 2022 12:33:36 -0400 Subject: [PATCH 4/5] update test note --- data_schema/tests/model_tests.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/data_schema/tests/model_tests.py b/data_schema/tests/model_tests.py index 8883a50..f14f95e 100644 --- a/data_schema/tests/model_tests.py +++ b/data_schema/tests/model_tests.py @@ -12,6 +12,9 @@ def test_unicode(self): self.assertEqual(str(field), u'10 - key - Field') def test_display_name_no_character_limit(self): + """ + Test to ensure that we are no longer running into the 64 character limit for display_name on the FieldSchema + """ data_schema = G(DataSchema) field_schema = FieldSchema( data_schema=data_schema, From 8c7208acb11946bcaabd49cef634dddd73734b2f Mon Sep 17 00:00:00 2001 From: Corinne Kinzy Date: Thu, 18 Aug 2022 13:56:20 -0400 Subject: [PATCH 5/5] update version number --- data_schema/docs/release_notes.rst | 2 +- data_schema/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data_schema/docs/release_notes.rst b/data_schema/docs/release_notes.rst index 2576533..163ef5f 100644 --- a/data_schema/docs/release_notes.rst +++ b/data_schema/docs/release_notes.rst @@ -1,6 +1,6 @@ Release Notes -v1.4.1 +v1.5.0 ------ * Update display_name field on FieldSchema to no longer have a char limit. diff --git a/data_schema/version.py b/data_schema/version.py index 8e3c933..77f1c8e 100644 --- a/data_schema/version.py +++ b/data_schema/version.py @@ -1 +1 @@ -__version__ = '1.4.1' +__version__ = '1.5.0'