Skip to content

Commit

Permalink
Added documentation for serializer fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Relrin committed Dec 7, 2016
1 parent e3a9308 commit d22724a
Show file tree
Hide file tree
Showing 6 changed files with 860 additions and 136 deletions.
5 changes: 1 addition & 4 deletions aiorest_ws/db/orm/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ class AbstractSerializer(object):

def __init__(self, read_only=False, write_only=False, required=None,
default=empty, initial=empty, source=None, label=None,
help_text=None, style=None, error_messages=None,
validators=None, allow_null=False):
error_messages=None, validators=None, allow_null=False):
self._creation_counter = AbstractField._creation_counter
AbstractField._creation_counter += 1

Expand All @@ -70,8 +69,6 @@ def __init__(self, read_only=False, write_only=False, required=None,
self.source = source
self.initial = self.initial if (initial is empty) else initial
self.label = label
self.help_text = help_text
self.style = {} if style is None else style
self.allow_null = allow_null

# Set `required` by default to `True` value, unless specified
Expand Down
3 changes: 1 addition & 2 deletions aiorest_ws/utils/date/humanize_datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ def humanize_timedelta(timedelta, display="long", sep=", "):
"""
Turns a datetime.timedelta object into a nice string representation.
"""
assert isinstance(timedelta, datetime.timedelta), \
"First argument must be a timedelta."
assert isinstance(timedelta, datetime.timedelta), "First argument must be a timedelta." # NOQA

result = []

Expand Down
Loading

0 comments on commit d22724a

Please sign in to comment.