friendsmap/map/fields.py

12 lines
392 B
Python
Raw Permalink Normal View History

2019-03-02 12:47:44 +01:00
from django.db import models
class CoordinateField(models.DecimalField):
def __init__(self, *args, **kwargs):
kwargs['max_digits'] = 11
kwargs['decimal_places'] = 8
kwargs['help_text'] = ('Format : xxx,xxxxxxxx<br>'
2019-03-03 13:10:32 +01:00
'(max 8 decimal places, max 3 digits before comma, separator : comma)')
2019-03-02 12:47:44 +01:00
super().__init__(*args, **kwargs)