コード例 #1
0
ファイル: feeds.py プロジェクト: iMax-pp/pintme
	def get(self):

		messages = Message.gql("ORDER BY date DESC LIMIT 30")

		template_values = {
			'title': 'PintMe General Feed',
			'link': 'http://pintme.appspot.com/',
			'description': 'PintMe General Feed',
			'items': messages
		}

		# We get the template path then show it
		path = os.path.join(os.path.dirname(__file__), '../views/rss.html')
		self.response.out.write(template.render(path, template_values))
コード例 #2
0
ファイル: feeds.py プロジェクト: iMax-pp/pintme
	def get(self, nickname):

		account = Account.gql("WHERE nickname = :1", nickname).get()
		messages = Message.gql("WHERE author IN :1 ORDER BY date DESC LIMIT 10", account.following)

		template_values = {
			'title': nickname + '\'s feed',
			'link': 'http://pintme.appspot.com/user/' + nickname,
			'description': 'Personnal user feed for ' + nickname,
			'items': messages
		}

		# We get the template path then show it
		path = os.path.join(os.path.dirname(__file__), '../views/rss.xml')
		self.response.out.write(template.render(path, template_values))
コード例 #3
0
ファイル: postio.py プロジェクト: iMax-pp/pintme
    def getAllMessages(self, limit = 10):

        return Message.gql("ORDER BY date DESC").fetch(limit)
コード例 #4
0
ファイル: postio.py プロジェクト: iMax-pp/pintme
    def getMessages(self, account, limit = 10):

        if account:
            return Message.gql( "WHERE author IN :1 ORDER BY date DESC", account.following ).fetch( limit )
        else:
            return list()
コード例 #5
0
ファイル: postio.py プロジェクト: iMax-pp/pintme
    def getSentMessages(self, account, limit = 10):

        if account:
            return Message.gql( "WHERE author = :1 ORDER BY date DESC", account.key() ).fetch( limit )
        else:
            return list()