Ejemplo n.º 1
0
	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))
Ejemplo n.º 2
0
	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))
Ejemplo n.º 3
0
    def getAllMessages(self, limit = 10):

        return Message.gql("ORDER BY date DESC").fetch(limit)
Ejemplo n.º 4
0
    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()
Ejemplo n.º 5
0
    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()