maps: order map layers alphabetically (#16907)
This commit is contained in:
parent
3437832be3
commit
0e44c38f0c
|
@ -21,5 +21,6 @@ class Migration(migrations.Migration):
|
|||
('icon', models.CharField(blank=True, max_length=32, null=True, verbose_name='Marker icon', choices=[(b'house', 'House'), (b'building', 'Building'), (b'hospital', 'Hospital'), (b'ambulance', 'Ambulance'), (b'taxi', 'Taxi'), (b'subway', 'Subway'), (b'wheelchair', 'Wheelchair'), (b'bicycle', 'Bicycle'), (b'car', 'Car'), (b'train', 'Train'), (b'bus', 'Bus'), (b'motorcycle', 'Motorcycle'), (b'truck', 'Truck')])),
|
||||
('icon_colour', models.CharField(default=b'#FFFFFF', max_length=7, verbose_name='Icon colour')),
|
||||
],
|
||||
options={'ordering': ('label',)}
|
||||
),
|
||||
]
|
||||
|
|
|
@ -64,6 +64,9 @@ class MapLayer(models.Model):
|
|||
_('Include user identifier in request'),
|
||||
default=True)
|
||||
|
||||
class Meta:
|
||||
ordering = ('label',)
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
if not self.slug:
|
||||
base_slug = slugify(self.label)
|
||||
|
|
Loading…
Reference in New Issue