Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions flask_restless/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,12 +326,12 @@ def url_for(self, model, **kw):
collection_name = self.created_apis_for[model].collection_name
blueprint_name = self.created_apis_for[model].blueprint_name
api_name = APIManager.api_name(collection_name)
parts = [blueprint_name, api_name]
view_name = '{}.{}'.format(blueprint_name, api_name)
# If we are looking for a relationship URL, the view name ends with
# '.relationships'.
# '_relationships'.
if 'relationship' in kw and kw.pop('relationship'):
parts.append('relationships')
url = flask_url_for('.'.join(parts), **kw)
view_name = '{}_relationships'.format(view_name)
url = flask_url_for(view_name, **kw)
# if _absolute_url:
# url = urljoin(request.url_root, url)
return url
Expand Down Expand Up @@ -752,7 +752,7 @@ def create_api_blueprint(self, name, model, methods=READONLY_METHODS,
# :http:get:`/api/articles/1/relationships/author` interpret the
# word `relationships` as the name of a relation of an article
# object.
relationship_api_name = '{0}.relationships'.format(apiname)
relationship_api_name = '{0}_relationships'.format(apiname)
rapi_view = RelationshipAPI.as_view
adftmr = allow_delete_from_to_many_relationships
relationship_api_view = \
Expand Down