add Point model
This commit is contained in:
parent
84b826e261
commit
e8e4e9fd40
2 changed files with 42 additions and 0 deletions
30
src/c3nav/mapdata/migrations/0070_point.py
Normal file
30
src/c3nav/mapdata/migrations/0070_point.py
Normal file
|
@ -0,0 +1,30 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.7 on 2017-05-10 13:30
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import c3nav.mapdata.fields
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('mapdata', '0069_auto_20170510_1329'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Point',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('geometry', c3nav.mapdata.fields.GeometryField(geomtype='point')),
|
||||
('space', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='points', to='mapdata.Space', verbose_name='space')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Point',
|
||||
'verbose_name_plural': 'Points',
|
||||
'default_related_name': 'points',
|
||||
},
|
||||
),
|
||||
]
|
|
@ -110,3 +110,15 @@ class LineObstacle(SpaceGeometryMixin, models.Model):
|
|||
# noinspection PyTypeChecker
|
||||
result['width'] = float(self.width)
|
||||
return result
|
||||
|
||||
|
||||
class Point(SpaceGeometryMixin, models.Model):
|
||||
"""
|
||||
An point in a space.
|
||||
"""
|
||||
geometry = GeometryField('point')
|
||||
|
||||
class Meta:
|
||||
verbose_name = _('Point')
|
||||
verbose_name_plural = _('Points')
|
||||
default_related_name = 'points'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue