diff options
| author | Tom Christie | 2012-01-21 18:36:25 +0000 |
|---|---|---|
| committer | Tom Christie | 2012-01-21 18:36:25 +0000 |
| commit | d1ce9d3914010ddc9f177ff7d6c1a407efea5a1b (patch) | |
| tree | 4444e26c28104d28bc1c04e572d6ad4783c0b3bc /djangorestframework/mixins.py | |
| parent | dea4a45ec72d0bd3cfeeb9382f177eb2fc3b0e14 (diff) | |
| download | django-rest-framework-d1ce9d3914010ddc9f177ff7d6c1a407efea5a1b.tar.bz2 | |
More consistent comment style.
Diffstat (limited to 'djangorestframework/mixins.py')
| -rw-r--r-- | djangorestframework/mixins.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/djangorestframework/mixins.py b/djangorestframework/mixins.py index 4077b66c..7f0870f8 100644 --- a/djangorestframework/mixins.py +++ b/djangorestframework/mixins.py @@ -689,7 +689,9 @@ class PaginatorMixin(object): limit = 20 def get_limit(self): - """ Helper method to determine what the `limit` should be """ + """ + Helper method to determine what the `limit` should be + """ try: limit = int(self.request.GET.get('limit', self.limit)) return min(limit, self.limit) @@ -697,7 +699,9 @@ class PaginatorMixin(object): return self.limit def url_with_page_number(self, page_number): - """ Constructs a url used for getting the next/previous urls """ + """ + Constructs a url used for getting the next/previous urls + """ url = URLObject.parse(self.request.get_full_path()) url = url.add_query_param('page', page_number) @@ -708,7 +712,9 @@ class PaginatorMixin(object): return url def next(self, page): - """ Returns a url to the next page of results (if any) """ + """ + Returns a url to the next page of results (if any) + """ if not page.has_next(): return None @@ -722,7 +728,9 @@ class PaginatorMixin(object): return self.url_with_page_number(page.previous_page_number()) def serialize_page_info(self, page): - """ This is some useful information that is added to the response """ + """ + This is some useful information that is added to the response + """ return { 'next': self.next(page), 'page': page.number, |
