Addes help_texts and translations.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
|
||||
from django.db import models
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.core.validators import MaxValueValidator, MinValueValidator
|
||||
|
||||
from taggit.managers import TaggableManager
|
||||
@@ -27,13 +28,15 @@ class Mapable(models.Model):
|
||||
validators=[
|
||||
MinValueValidator(-90),
|
||||
MaxValueValidator(90)
|
||||
]
|
||||
],
|
||||
help_text=_('Latitude in decimal format: e. g. 41.40338')
|
||||
)
|
||||
longitude = models.FloatField(
|
||||
validators=[
|
||||
MinValueValidator(-180),
|
||||
MaxValueValidator(180)
|
||||
]
|
||||
],
|
||||
help_text=_('Longitude in decimal format: e. g. 2.17403')
|
||||
)
|
||||
|
||||
class Submittable(models.Model):
|
||||
|
@@ -4,6 +4,7 @@ from django.db import models
|
||||
from django.urls import reverse
|
||||
from django.dispatch import receiver
|
||||
from django.db.models.signals import post_delete, pre_save
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from lostplaces.models.abstract_models import Submittable, Taggable, Mapable
|
||||
|
||||
@@ -15,8 +16,8 @@ class Place(Submittable, Taggable, Mapable):
|
||||
Place defines a lost place (location, name, description etc.).
|
||||
"""
|
||||
|
||||
location = models.CharField(max_length=50)
|
||||
description = models.TextField()
|
||||
location = models.CharField(max_length=50, help_text=_('Location'))
|
||||
description = models.TextField(help_text=_('Description'))
|
||||
|
||||
def get_absolute_url(self):
|
||||
return reverse('place_detail', kwargs={'pk': self.pk})
|
||||
|
Reference in New Issue
Block a user