Ajout d'une entrée code postal
This commit is contained in:
parent
bd1330cd2f
commit
f52caf9855
18
src/agenda_culturel/migrations/0124_place_postcode.py
Normal file
18
src/agenda_culturel/migrations/0124_place_postcode.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 4.2.9 on 2024-12-06 21:37
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('agenda_culturel', '0123_event_created_by_user_event_imported_by_user_and_more'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='place',
|
||||||
|
name='postcode',
|
||||||
|
field=models.CharField(blank=True, help_text='The post code is not displayed, but makes it easier to find an address when you enter it.', null=True, verbose_name='Postcode'),
|
||||||
|
),
|
||||||
|
]
|
@ -435,8 +435,9 @@ class Place(models.Model):
|
|||||||
blank=True,
|
blank=True,
|
||||||
null=True,
|
null=True,
|
||||||
)
|
)
|
||||||
|
postcode = models.CharField(verbose_name=_("Postcode"), help_text=_("The post code is not displayed, but makes it easier to find an address when you enter it."), blank=True, null=True)
|
||||||
city = models.CharField(verbose_name=_("City"), help_text=_("City name"))
|
city = models.CharField(verbose_name=_("City"), help_text=_("City name"))
|
||||||
location = LocationField(based_fields=["name", "address", "city"], zoom=12, default=Point(3.08333, 45.783329))
|
location = LocationField(based_fields=["name", "address", "postcode", "city"], zoom=12, default=Point(3.08333, 45.783329))
|
||||||
|
|
||||||
description = CKEditor5Field(
|
description = CKEditor5Field(
|
||||||
verbose_name=_("Description"),
|
verbose_name=_("Description"),
|
||||||
|
@ -1880,6 +1880,7 @@ class PlaceFromEventCreateView(PlaceCreateView):
|
|||||||
name, address, postcode, city = guesser.guess_address_elements(self.event.location)
|
name, address, postcode, city = guesser.guess_address_elements(self.event.location)
|
||||||
initial["name"] = name
|
initial["name"] = name
|
||||||
initial["address"] = address
|
initial["address"] = address
|
||||||
|
initial["postcode"] = postcode
|
||||||
initial["city"] = city
|
initial["city"] = city
|
||||||
initial["location"] = ""
|
initial["location"] = ""
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user