amélioration UX ajout lieu

This commit is contained in:
Jean-Marie Favreau 2024-04-27 19:41:43 +02:00
parent 8119ea98cd
commit 32bde7d3a8
2 changed files with 2 additions and 2 deletions

View File

@ -295,7 +295,7 @@ class CategorisationForm(Form):
class EventAddPlaceForm(Form): class EventAddPlaceForm(Form):
place = ModelChoiceField(label=_("Place"), queryset=Place.objects.all(), empty_label=_("Create a missing place"), required=False) place = ModelChoiceField(label=_("Place"), queryset=Place.objects.all().order_by("name"), empty_label=_("Create a missing place"), required=False)
add_alias = BooleanField(initial=True, required=False) add_alias = BooleanField(initial=True, required=False)
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):

View File

@ -171,7 +171,7 @@ class Place(models.Model):
verbose_name_plural = _('Places') verbose_name_plural = _('Places')
def __str__(self): def __str__(self):
return self.name + ", " + self.address return self.name + ", " + self.address + ", " + self.city
def get_absolute_url(self): def get_absolute_url(self):
return reverse("view_place", kwargs={"pk": self.pk}) return reverse("view_place", kwargs={"pk": self.pk})