diff --git a/src/fellchensammlung/migrations/0041_location_city_location_country_location_housenumber_and_more.py b/src/fellchensammlung/migrations/0041_location_city_location_country_location_housenumber_and_more.py new file mode 100644 index 0000000..bd9d5e8 --- /dev/null +++ b/src/fellchensammlung/migrations/0041_location_city_location_country_location_housenumber_and_more.py @@ -0,0 +1,42 @@ +# Generated by Django 5.1.4 on 2025-04-06 06:37 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('fellchensammlung', '0040_alter_rescueorganization_allows_using_materials'), + ] + + operations = [ + migrations.AddField( + model_name='location', + name='city', + field=models.CharField(blank=True, max_length=200, null=True), + ), + migrations.AddField( + model_name='location', + name='country', + field=models.CharField(blank=True, help_text='Standardisierter Ländercode nach ISO 3166-1 ALPHA-2', max_length=2, null=True, verbose_name='Ländercode'), + ), + migrations.AddField( + model_name='location', + name='housenumber', + field=models.CharField(blank=True, max_length=20, null=True), + ), + migrations.AddField( + model_name='location', + name='postcode', + field=models.CharField(blank=True, max_length=20, null=True), + ), + migrations.AddField( + model_name='location', + name='street', + field=models.CharField(blank=True, max_length=200, null=True), + ), + migrations.AlterUniqueTogether( + name='rescueorganization', + unique_together={('external_object_identifier', 'external_source_identifier')}, + ), + ] diff --git a/src/fellchensammlung/models.py b/src/fellchensammlung/models.py index f812566..c31c7d7 100644 --- a/src/fellchensammlung/models.py +++ b/src/fellchensammlung/models.py @@ -43,6 +43,15 @@ class Location(models.Model): latitude = models.FloatField() longitude = models.FloatField() name = models.CharField(max_length=2000) + city = models.CharField(max_length=200, blank=True, null=True) + housenumber = models.CharField(max_length=20, blank=True, null=True) + postcode = models.CharField(max_length=20, blank=True, null=True) + street = models.CharField(max_length=200, blank=True, null=True) + # Country code as per ISO 3166-1 alpha-2 + # https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes + country = models.CharField(max_length=2, verbose_name=_("Ländercode"), + help_text=_("Standardisierter Ländercode nach ISO 3166-1 ALPHA-2"), + blank=True, null=True) updated_at = models.DateTimeField(auto_now=True) created_at = models.DateTimeField(auto_now_add=True)