0001-maps-allow-variables-in-geojson-URLs-36124.patch
combo/apps/maps/forms.py | ||
---|---|---|
17 | 17 |
from django import forms |
18 | 18 |
from django.utils.encoding import force_text |
19 | 19 |
from django.utils.text import slugify |
20 |
from django.utils.translation import ugettext_lazy as _ |
|
20 | 21 | |
22 |
from combo.data.fields import TemplatableURLField |
|
21 | 23 |
from .models import MapLayer |
22 | 24 | |
23 | 25 | |
... | ... | |
26 | 28 | |
27 | 29 | |
28 | 30 |
class MapNewLayerForm(forms.ModelForm): |
31 |
geojson_url = TemplatableURLField(label=_('Geojson URL')) |
|
32 | ||
29 | 33 |
class Meta: |
30 | 34 |
model = MapLayer |
31 | 35 |
exclude = ('slug', 'cache_duration', 'include_user_identifier') |
... | ... | |
41 | 45 | |
42 | 46 | |
43 | 47 |
class MapLayerForm(forms.ModelForm): |
48 |
geojson_url = TemplatableURLField(label=_('Geojson URL')) |
|
49 | ||
44 | 50 |
class Meta: |
45 | 51 |
model = MapLayer |
46 | 52 |
fields = '__all__' |
combo/apps/maps/migrations/0001_initial.py | ||
---|---|---|
17 | 17 |
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), |
18 | 18 |
('label', models.CharField(max_length=128, verbose_name='Label')), |
19 | 19 |
('slug', models.SlugField(verbose_name='Identifier')), |
20 |
('geojson_url', models.URLField(max_length=1024, verbose_name='Geojson URL')),
|
|
20 |
('geojson_url', models.CharField(max_length=1024, verbose_name='Geojson URL')),
|
|
21 | 21 |
('marker_colour', models.CharField(default=b'#0000FF', max_length=7, verbose_name='Marker colour')), |
22 | 22 |
('icon', models.CharField(blank=True, max_length=32, null=True, verbose_name='Marker icon', choices=ICONS)), |
23 | 23 |
('icon_colour', models.CharField(default=b'#000000', max_length=7, verbose_name='Icon colour')), |
combo/apps/maps/models.py | ||
---|---|---|
96 | 96 | |
97 | 97 |
label = models.CharField(_('Label'), max_length=128) |
98 | 98 |
slug = models.SlugField(_('Identifier')) |
99 |
geojson_url = models.URLField(_('Geojson URL'), max_length=1024)
|
|
99 |
geojson_url = models.CharField(_('Geojson URL'), max_length=1024)
|
|
100 | 100 |
marker_colour = models.CharField(_('Marker colour'), max_length=7, default='#0000FF') |
101 | 101 |
icon = models.CharField(_('Marker icon'), max_length=32, blank=True, null=True, |
102 | 102 |
choices=ICONS) |
103 |
- |