Skip to content

Instantly share code, notes, and snippets.

@luizdepra
Created July 11, 2012 18:27
Show Gist options
  • Save luizdepra/3092183 to your computer and use it in GitHub Desktop.
Save luizdepra/3092183 to your computer and use it in GitHub Desktop.
DataBase
from google.appengine.ext import db
class Post(db.Model):
title = db.StringProperty()
slug = db.StringProperty()
date = db.DateTimeProperty(auto_now_add=True)
author = db.StringProperty()
content = db.TextProperty()
category = db.ReferenceProperty(Category, collection_name='posts')
tags = db.ListProperty(db.Key)
class Page(db.Model):
title = db.StringProperty()
slug = db.StringProperty()
content = db.TextProperty()
class Tag(db.Model):
title = db.StringProperty()
slug = db.StringProperty()
class Category(db.Model):
title = db.StringProperty()
slug = db.StringProperty()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment