allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jetm...@apache.org
Subject [6/6] allura git commit: [#7794] ticket:677 Remove hard limit on page size where it makes sense
Date Fri, 14 Nov 2014 11:55:54 GMT
[#7794] ticket:677 Remove hard limit on page size where it makes sense


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/d277d218
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/d277d218
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/d277d218

Branch: refs/heads/ib/7794
Commit: d277d2185102baaf9d781e7b99d7183a4c4f0651
Parents: 9e3eb5f
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Fri Nov 14 08:13:15 2014 +0000
Committer: Igor Bondarenko <jetmind2@gmail.com>
Committed: Fri Nov 14 08:57:43 2014 +0000

----------------------------------------------------------------------
 ForgeDiscussion/forgediscussion/controllers/forum.py |  4 ++--
 ForgeDiscussion/forgediscussion/controllers/root.py  | 12 ++++++------
 ForgeShortUrl/forgeshorturl/main.py                  |  4 ++--
 ForgeWiki/forgewiki/wiki_main.py                     |  2 +-
 4 files changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/d277d218/ForgeDiscussion/forgediscussion/controllers/forum.py
----------------------------------------------------------------------
diff --git a/ForgeDiscussion/forgediscussion/controllers/forum.py b/ForgeDiscussion/forgediscussion/controllers/forum.py
index c83adaf..67dbea3 100644
--- a/ForgeDiscussion/forgediscussion/controllers/forum.py
+++ b/ForgeDiscussion/forgediscussion/controllers/forum.py
@@ -99,8 +99,8 @@ class ForumController(DiscussionController):
 
     @expose('jinja:forgediscussion:templates/index.html')
     @validate(dict(page=validators.Int(if_empty=0, if_invalid=0),
-                   limit=validators.Int(if_empty=25, if_invalid=25)))
-    def index(self, threads=None, limit=25, page=0, count=0, **kw):
+                   limit=validators.Int(if_empty=None, if_invalid=None)))
+    def index(self, threads=None, limit=None, page=0, count=0, **kw):
         if self.discussion.deleted:
             redirect(self.discussion.url() + 'deleted')
         limit, page, start = g.handle_paging(limit, page)

http://git-wip-us.apache.org/repos/asf/allura/blob/d277d218/ForgeDiscussion/forgediscussion/controllers/root.py
----------------------------------------------------------------------
diff --git a/ForgeDiscussion/forgediscussion/controllers/root.py b/ForgeDiscussion/forgediscussion/controllers/root.py
index 9256662..cf1116e 100644
--- a/ForgeDiscussion/forgediscussion/controllers/root.py
+++ b/ForgeDiscussion/forgediscussion/controllers/root.py
@@ -307,8 +307,8 @@ class RootRestController(BaseController):
         return ForumRestController(unquote(forum)), remainder
 
     @expose('json:')
-    def index(self, limit=100, page=0, **kw):
-        limit, page, start = g.handle_paging(int(limit), int(page))
+    def index(self, limit=None, page=0, **kw):
+        limit, page, start = g.handle_paging(limit, int(page))
         forums = model.Forum.query.find(dict(
             app_config_id=c.app.config._id,
             parent_id=None, deleted=False)
@@ -377,8 +377,8 @@ class ForumRestController(BaseController):
         require_access(self.forum, 'read')
 
     @expose('json:')
-    def index(self, limit=100, page=0, **kw):
-        limit, page, start = g.handle_paging(int(limit), int(page))
+    def index(self, limit=None, page=0, **kw):
+        limit, page, start = g.handle_paging(limit, int(page))
         topics = model.Forum.thread_class().query.find(
             dict(discussion_id=self.forum._id))
         topics = topics.sort([('flags', pymongo.DESCENDING),
@@ -423,8 +423,8 @@ class ForumTopicRestController(BaseController):
         require_access(self.forum, 'read')
 
     @expose('json:')
-    def index(self, limit=100, page=0, **kw):
-        limit, page, start = g.handle_paging(int(limit), int(page))
+    def index(self, limit=None, page=0, **kw):
+        limit, page, start = g.handle_paging(limit, int(page))
         json_data = {}
         json_data['topic'] = self.topic.__json__(limit=limit, page=page)
         json_data['count'] = self.topic.query_posts(status='ok').count()

http://git-wip-us.apache.org/repos/asf/allura/blob/d277d218/ForgeShortUrl/forgeshorturl/main.py
----------------------------------------------------------------------
diff --git a/ForgeShortUrl/forgeshorturl/main.py b/ForgeShortUrl/forgeshorturl/main.py
index 377fa62..f4ab4ed 100644
--- a/ForgeShortUrl/forgeshorturl/main.py
+++ b/ForgeShortUrl/forgeshorturl/main.py
@@ -132,8 +132,8 @@ class RootController(BaseController):
 
     @expose('jinja:forgeshorturl:templates/index.html')
     @validate(dict(page=validators.Int(if_empty=0, if_invalid=0),
-                   limit=validators.Int(if_empty=100, if_invalid=100)))
-    def index(self, page=0, limit=100, **kw):
+                   limit=validators.Int(if_empty=None, if_invalid=None)))
+    def index(self, page=0, limit=None, **kw):
         c.page_list = W.page_list
         c.page_size = W.page_size
         limit, pagenum, start = g.handle_paging(limit, page, default=100)

http://git-wip-us.apache.org/repos/asf/allura/blob/d277d218/ForgeWiki/forgewiki/wiki_main.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/wiki_main.py b/ForgeWiki/forgewiki/wiki_main.py
index e32a741..8539409 100644
--- a/ForgeWiki/forgewiki/wiki_main.py
+++ b/ForgeWiki/forgewiki/wiki_main.py
@@ -409,7 +409,7 @@ class RootController(BaseController, DispatchIndex, FeedController):
     @expose('jinja:forgewiki:templates/wiki/browse_tags.html')
     @validate(dict(sort=validators.UnicodeString(if_empty='alpha'),
                    page=validators.Int(if_empty=0, if_invalid=0),
-                   limit=validators.Int(if_empty=25, if_invalid=25)))
+                   limit=validators.Int(if_empty=None, if_invalid=None)))
     def browse_tags(self, sort='alpha', page=0, limit=None, **kw):
         'list of all labels in the wiki'
         c.page_list = W.page_list


Mime
View raw message