Skip to content

Instantly share code, notes, and snippets.

@waqaraqeel
Created September 12, 2015 00:26
Show Gist options
  • Save waqaraqeel/ec75844649c912a85249 to your computer and use it in GitHub Desktop.
Save waqaraqeel/ec75844649c912a85249 to your computer and use it in GitHub Desktop.
# The Category table
class Category(models.Model):
# has only one field, name, which is unique
name = models.CharField(max_length=128, unique=True)
# The Place table
class Place(models.Model):
# every place has a category
category = models.ForeignKey(Category)
# place has a unique name
name = models.CharField(max_length=128, unique=True)
# title of the place, name is for internal use, while title is actually shown on webpages
title = models.CharField(max_length=128)
# subtitle, one line of text to be shown below the title
subtitle = models.CharField(max_length=256)
# place cover/banner image file
coverImage = models.ImageField()
# detailed description of place
description = models.TextField()
# detailed instructions for going to the place
gettingThere = models.TextField()
# latitude and longitude of the place, site administrator will have a nice map interface to input this
location = GeopositionField()
# tags for the place. These are managed tags just like the ones that work on instagram/twitter
tags = TaggableManager()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment