Created
January 12, 2013 13:37
-
-
Save srgist/4518120 to your computer and use it in GitHub Desktop.
PY:Datastore GAE commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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