Fix an issue showing attach/detach docs

There's a condition in sub_list_create_api_view.md template that
controls whether or not the attach/detach documentation is shown for
sublist elements that support it.   Looks like it's been this way for a
while.  This updates that condition to work anywhere it's needed
This commit is contained in:
Matthew Jones
2016-06-09 09:55:17 -04:00
parent 2e5c91b3fc
commit 3e8aaa4b5e
3 changed files with 8 additions and 2 deletions

View File

@@ -360,6 +360,13 @@ class SubListCreateAttachDetachAPIView(SubListCreateAPIView):
# Base class for a sublist view that allows for creating subobjects and
# attaching/detaching them from the parent.
def get_description_context(self):
d = super(SubListCreateAttachDetachAPIView, self).get_description_context()
d.update({
"has_attach": True,
})
return d
def attach(self, request, *args, **kwargs):
created = False
parent = self.get_parent_object()