remove section name
This commit is contained in:
parent
d3409e8941
commit
c4474f3a9f
2 changed files with 19 additions and 2 deletions
19
src/c3nav/mapdata/migrations/0006_remove_section_name.py
Normal file
19
src/c3nav/mapdata/migrations/0006_remove_section_name.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.7 on 2017-05-27 16:35
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('mapdata', '0005_auto_20170527_1556'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='section',
|
||||
name='name',
|
||||
),
|
||||
]
|
|
@ -13,7 +13,6 @@ class Section(SpecificLocation, EditorFormMixin, models.Model):
|
|||
"""
|
||||
A map section like a level
|
||||
"""
|
||||
name = models.SlugField(_('section name'), unique=True, max_length=50)
|
||||
altitude = models.DecimalField(_('section altitude'), null=False, unique=True, max_digits=6, decimal_places=2)
|
||||
|
||||
class Meta:
|
||||
|
@ -33,7 +32,6 @@ class Section(SpecificLocation, EditorFormMixin, models.Model):
|
|||
|
||||
def _serialize(self, section=True, **kwargs):
|
||||
result = super()._serialize(**kwargs)
|
||||
result['name'] = self.name
|
||||
result['altitude'] = float(str(self.altitude))
|
||||
return result
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue