Refactor ListingController so api_doc can get param info.

By moving @base_listing to the same function as @api_doc, the validators
@base_listing adds become accessible to the parameter documentation. As
far as I can tell, this is the only place build_listing is called, so I
believe this transformation is safe.
This commit is contained in:
Max Goodman
2012-03-21 10:32:20 -07:00
parent 1890d24ba0
commit ffca452407

View File

@@ -89,8 +89,7 @@ class ListingController(RedditController):
etc) to be displayed on this listing page"""
return []
@base_listing
def build_listing(self, num, after, reverse, count):
def build_listing(self, num, after, reverse, count, **kwargs):
"""uses the query() method to define the contents of the
listing and renders the page self.render_cls(..).render() with
the listing as contents"""
@@ -180,6 +179,7 @@ class ListingController(RedditController):
builder_wrapper = staticmethod(default_thing_wrapper())
@base_listing
def GET_listing(self, **env):
check_cheating('site')
return self.build_listing(**env)