Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as Python by eglyph ( 17 years ago )
from google.appengine.ext import db
class Article(db.Model):
title = db.StringProperty()
body = db.TextProperty()
published = db.DateTimeProperty(auto_now = True)
tag_names = db.ListProperty(db.Key)
@property
def tags(self):
tags = []
for tag_key in self.tag_names:
tags.append(db.get(tag_key).name)
return tags
class Tag(db.Model):
name = db.StringProperty()
@property
def members(self):
return Article.gql('WHERE tags = :1', self.key())
Revise this Paste
Children: 10204