Skip to content

Commit

Permalink
Fix relationship_descriptor docs
Browse files Browse the repository at this point in the history
rel_descriptor was renamed to relationship_descriptor
  • Loading branch information
duk3luk3 committed Jan 8, 2018
1 parent e920f8d commit ff0f02d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions docs/models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,27 @@ Relationship's come in two flavors: to-one and to-many (or tranditional and
LDS-flavored if you prefer those terms). To one descriptors have the actions
GET and SET::

@rel_descriptor(RelationshipActions.GET, 'significant_other')
from sqlalchemy_jsonapi import relationship_descriptor, RelationshipActions

@relationship_descriptor(RelationshipActions.GET, 'significant_other')
def getter(self):
# ...

@rel_descriptor(RelationshipActions.SET, 'significant_other')
@relationship_descriptor(RelationshipActions.SET, 'significant_other')
def setter(self, value):
# ...

To-many have GET, APPEND, and DELETE::

@rel_descriptor(RelationshipActions.GET, 'angry_exes')
@relationship_descriptor(RelationshipActions.GET, 'angry_exes')
def getter(self):
# ...

@rel_descriptor(RelationshipActions.APPEND, 'angry_exes')
@relationship_descriptor(RelationshipActions.APPEND, 'angry_exes')
def appender(self):
# ...

@rel_descriptor(RelationshipActions.DELETE, 'angry_exes')
@relationship_descriptor(RelationshipActions.DELETE, 'angry_exes')
def remover(self):
# ...

Expand Down

0 comments on commit ff0f02d

Please sign in to comment.