Commit 606b2530 authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

snf-django: PEP8 fixes

parent 2c055047
......@@ -138,7 +138,8 @@ def api_method(http_method=None, token_required=True, user_required=True,
return decorator
def get_serialization(request, format_allowed=True, default_serialization="json"):
def get_serialization(request, format_allowed=True,
"""Return the serialization format requested.
Valid formats are 'json' and 'xml' and 'text'
......@@ -191,7 +192,8 @@ def update_response_headers(request, response):
if not response.has_header("Content-Length"):
# compatibility code for django 1.4
_is_string = getattr(response, '_is_string', None)
_base_content_is_iter = getattr(response, '_base_content_is_iter', None)
_base_content_is_iter = getattr(response, '_base_content_is_iter',
if (_is_string is not None and _is_string) or\
(_base_content_is_iter is not None and
not _base_content_is_iter):
......@@ -32,6 +32,7 @@ from django.db.models import Manager
from django.db.models.query import QuerySet, EmptyQuerySet
from django.db.models.sql.datastructures import EmptyResultSet
class ForUpdateManager(Manager):
""" Model manager implementing SELECT .. FOR UPDATE statement
......@@ -171,7 +171,7 @@ def pprint_table(out, table, headers=None, output_format='pretty',
out.write( + "\n")
if headers:
# pretty print the headers
line = sep.join(uenc(v.rjust(w))\
line = sep.join(uenc(v.rjust(w))
for v, w in zip(headers, widths))
out.write(line + "\n")
out.write("-" * t_length + "\n")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment