def get(self, menu_identifier=None): LIST_NUMS = 10 query = Entry.all() query.filter("is_removed", False) query.order("-created_on") paging = Paging( query ) paging.setLimit( LIST_NUMS ) paging.execute() self.context['paging'] = paging self.render( "rss.xml" )
def get(self, type, site_user_id, cursor=None): logging.info( type ) if type != "entry" and type != "comment": self.siteError( SiteErrorType.ERROR_INVALID_ACCESS ) return if cursor: cursor = urllib.unquote(cursor).decode('utf-8') self.context['siteUser'] = User.get_by_id( int( site_user_id ) ) if type == "entry": query = Entry.all() query.filter("site_user_id", int( site_user_id) ) query.filter("is_removed", False) query.order("-created_on") elif type == "comment": query = Comment.all() query.filter("site_user_id", int( site_user_id) ) query.order("-created_on") logging.info( query.__dict__ ) paging = Paging( query ) paging.setLimit(10) paging.setCurrentCursor(cursor) paging.execute() self.context['paging'] = paging if type == "entry": self.render( "admin/entry.html" ) elif type == "comment": self.render( "admin/comment.html" )
def get(self, menu_identifier=None, cursor=None): if menu_identifier is None or not Menu.isRightIdentifier(menu_identifier): self.siteError( SiteErrorType.ERROR_MENU_NOT_EXIST ) return self.context['menu_id'] = Menu.getMenuIdWithIdentifier( menu_identifier ) self.context['menu_label'] = Menu.getLabel( self.context['menu_id'] ) self.context['menu_identifier'] = menu_identifier LIST_NUMS = 5 if cursor: cursor = urllib.unquote(cursor).decode('utf-8') query = Entry.all() query.filter("menu_id", self.context['menu_id'] ) query.filter("is_removed", False) query.order("-created_on") paging = Paging( query ) paging.setCurrentCursor( cursor ) paging.setLimit( LIST_NUMS ) paging.execute() self.context['paging'] = paging self.render( "list.html" )
def get(self, menu_identifier=None): LIST_NUMS = 10 query = Entry.all() query.filter("is_removed", False) query.order("-created_on") paging = Paging( query ) paging.setLimit( LIST_NUMS ) paging.execute() self.context['paging'] = paging self.response.headers['Content-Type'] = "application/xml" from google.appengine.ext.webapp import template path = os.path.join( os.path.dirname(__file__), '../template/sitemap.xml' ) self.response.out.write( template.render( path, self.context ) )
def get(self, cursor=None): if cursor: cursor = urllib.unquote(cursor).decode('utf-8') query = User.all() query.order("-join_on") paging = Paging( query ) paging.setLimit(20) paging.setCurrentCursor(cursor) paging.execute() self.context['paging'] = paging self.render( "admin/user.html" )
def get(self, cursor=None): if cursor: cursor = urllib.unquote(cursor).decode('utf-8') query = Comment.all() query.order("-created_on") paging = Paging(query) paging.setLimit(10) paging.setCurrentCursor(cursor) paging.execute() self.context['paging'] = paging self.render( "admin/comment.html" )
def get(self, cursor=None): LIST_NUMS = 10 if cursor: cursor = urllib.unquote(cursor).decode('utf-8') self.context['siteUser'] = None query = Entry.all() query.filter("is_removed", False) query.order("-created_on") paging = Paging( query ) paging.setCurrentCursor( cursor ) paging.setLimit( LIST_NUMS ) paging.execute() self.context['paging'] = paging self.render( "admin/entry.html" )
def get(self, cursor=None): siteUser = User.getSiteUser( self.context['user'].get_current_user() ) if not siteUser: siteUser = User.insertUser(self.context['user'].get_current_user(), self.request.remote_addr ) self.context['siteUser'] = siteUser LIST_NUMS = 10 query = Entry.all() query.filter("site_user_id", User.getSiteUserId( self.context['user'].get_current_user() ) ) query.filter("is_removed", False ) query.order("-created_on") paging = Paging( query ) paging.setCurrentCursor( cursor ) paging.setLimit( LIST_NUMS ) paging.execute() self.context['paging'] = paging self.render("user.html")