Skip to content

Instantly share code, notes, and snippets.

@srgist
Created January 12, 2013 13:37
Show Gist options
  • Save srgist/4518120 to your computer and use it in GitHub Desktop.
Save srgist/4518120 to your computer and use it in GitHub Desktop.
PY:Datastore GAE commands
class Feeds(db.Model):
articleid = db.IntegerProperty()
feedlistid = db.IntegerProperty()
title = db.StringProperty()
itemurl = db.LinkProperty()
img = db.LinkProperty()
textmin = db.StringProperty()
textfull = db.TextProperty()
dated = db.DateTimeProperty()
isRead = db.BooleanProperty()
tags = db.StringListProperty()
list1 = list(db.GqlQuery("SELECT * FROM Feeds"))
oldlist = db.GqlQuery("SELECT * FROM FeedList WHERE url = :1 ",url).get()
def refreshall(self):
channels = db.GqlQuery("SELECT __key__ FROM FeedList")
for key in channels:
self.refreshchannel(key)
def refreshchannel(self,key=""):
c = db.get(key)
feedurl = c.url
lastupdated=c.lastupdated
c.lastupdated = newDate
def deletefeeds(self):
records = Feeds.all()
for p in records:
p.delete()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment