示例#1
0
文件: admin.py 项目: litmisty/pyweb
 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" )
示例#2
0
文件: admin.py 项目: litmisty/pyweb
 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" )