Add point of interest model
This commit is contained in:
parent
79dffadd14
commit
69e518240c
34
apps/map/migrations/0071_point_of_interest.py
Normal file
34
apps/map/migrations/0071_point_of_interest.py
Normal file
@ -0,0 +1,34 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.6 on 2018-10-12 22:48
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.conf import settings
|
||||
import django.contrib.gis.db.models.fields
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
import django_extensions.db.fields
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('map', '0070_remove_null_from_text_fields_schema'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='PointOfInterest',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('date_created', models.DateTimeField(auto_now_add=True)),
|
||||
('slug', django_extensions.db.fields.AutoSlugField(blank=True, editable=False, populate_from=['entry_name'])),
|
||||
('approved', models.BooleanField(default=False)),
|
||||
('title', models.CharField(max_length=128)),
|
||||
('location', django.contrib.gis.db.models.fields.PointField(srid=4326)),
|
||||
('synopsis', models.TextField()),
|
||||
('link', models.URLField()),
|
||||
('author', models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
),
|
||||
]
|
@ -1012,3 +1012,25 @@ class CaseStudy(models.Model):
|
||||
|
||||
class Meta:
|
||||
verbose_name_plural = 'case studies'
|
||||
|
||||
|
||||
|
||||
class PointOfInterest(models.Model):
|
||||
author = models.ForeignKey(
|
||||
User,
|
||||
models.SET_NULL,
|
||||
blank=True,
|
||||
null=True,
|
||||
editable=False
|
||||
)
|
||||
|
||||
date_created = models.DateTimeField(auto_now_add=True, null=False)
|
||||
|
||||
slug = AutoSlugField(populate_from=['entry_name'], editable=False)
|
||||
|
||||
approved = models.BooleanField(default=False)
|
||||
|
||||
title = models.CharField(max_length=128)
|
||||
location = models.PointField()
|
||||
synopsis = models.TextField()
|
||||
link = models.URLField()
|
||||
|
Loading…
Reference in New Issue
Block a user