Commit dac931da authored by Aljaž Srebrnič's avatar Aljaž Srebrnič

Modificato modello location

Le `location` hanno un nome e una descrizione. Opzionalmente possono
avere una mappa e coordinate (da implementare in futuro)
parent 8b72fd60
# Generated by Django 2.0.1 on 2018-01-14 21:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('locations', '0005_auto_20170902_2011'),
]
operations = [
migrations.AddField(
model_name='location',
name='name',
field=models.CharField(default='', max_length=25),
preserve_default=False,
),
]
# Generated by Django 2.0.1 on 2018-01-14 21:52
import django.contrib.gis.db.models.fields
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('locations', '0006_location_name'),
]
operations = [
migrations.AlterField(
model_name='location',
name='coord',
field=django.contrib.gis.db.models.fields.PointField(null=True, srid=4326),
),
migrations.AlterField(
model_name='location',
name='map',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='locations.Map'),
),
]
......@@ -8,8 +8,9 @@ class Map(models.Model):
class Location(models.Model):
map = models.ForeignKey(Map, blank=True,on_delete=models.CASCADE)
coord = models.PointField(blank=True)
name = models.CharField(max_length=25, null=False)
map = models.ForeignKey(Map, null=True, on_delete=models.CASCADE)
coord = models.PointField(null=True)
description = models.CharField(max_length=80, null=False)
def clean(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment