Skip to content

Commit

Permalink
Merge pull request #33 from ajite/correct-serializer-doc
Browse files Browse the repository at this point in the history
doc: missing self on CustomSerializer serialize
  • Loading branch information
mrevutskyi authored May 25, 2022
2 parents 9c8ff08 + 84f3b33 commit d964ae8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/customizing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ Define your serialization functions like this::
def relationship_columns(self):
return set(self.relationships)

def serialize(instance, only=None):
def serialize(self, instance, only=None):
return {'id': instance.id, 'type': 'custom', 'attributes': {}}

``instance`` is an instance of a SQLAlchemy model and the ``only`` argument is
Expand Down Expand Up @@ -467,7 +467,7 @@ authentication function can be implemented like this::
# instance of the model.
if not is_authorized_to_modify(current_user, instance_id):
raise ProcessingException(detail='Not Authorized', status=401)
manager.create_api(Person, preprocessors=dict(GET_SINGLE=[check_auth]))
manager.create_api(Person, preprocessors=dict(GET_RESOURCE=[check_auth]))
The :exc:`ProcessingException` allows you to specify as keyword arguments to
the constructor the elements of the JSON API `error object`_. If no arguments
Expand Down

0 comments on commit d964ae8

Please sign in to comment.