From 239fac8e28d8e995b90a7601eeb3b5f06d1751f9 Mon Sep 17 00:00:00 2001 From: pdelboca Date: Sat, 6 Jan 2024 17:56:35 -0300 Subject: [PATCH] Catalog license should not be mandatory --- dcat/migrations/0013_alter_catalog_licence.py | 23 +++++++++++++++++++ dcat/models.py | 2 +- setup.cfg | 2 +- 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 dcat/migrations/0013_alter_catalog_licence.py diff --git a/dcat/migrations/0013_alter_catalog_licence.py b/dcat/migrations/0013_alter_catalog_licence.py new file mode 100644 index 0000000..a2757fd --- /dev/null +++ b/dcat/migrations/0013_alter_catalog_licence.py @@ -0,0 +1,23 @@ +# Generated by Django 5.0 on 2024-01-06 20:55 + +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("dcat", "0012_distribution_external_access_url"), + ] + + operations = [ + migrations.AlterField( + model_name="catalog", + name="licence", + field=models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + to="dcat.licencedocument", + ), + ), + ] diff --git a/dcat/models.py b/dcat/models.py index 3f0b3c4..910fba6 100644 --- a/dcat/models.py +++ b/dcat/models.py @@ -38,9 +38,9 @@ class Catalog(models.Model): title = models.CharField(max_length=255) description = models.TextField() publisher = models.ForeignKey("Agent", on_delete=models.CASCADE) - licence = models.ForeignKey("LicenceDocument", on_delete=models.SET_NULL, null=True) # Recommended properties + licence = models.ForeignKey("LicenceDocument", on_delete=models.SET_NULL, blank=True, null=True) themes = models.ManyToManyField("DataTheme", blank=True) homepage = models.URLField(blank=True) diff --git a/setup.cfg b/setup.cfg index 90b8556..fa86bf4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = django-dcat -version = 0.0.5 +version = 0.0.6 description = A Django app that provides a model layer and tools for DCAT applications. long_description = file: README.rst url = https://github.com/pdelboca/django-dcat/