Skip to content

Commit

Permalink
Fix missing new parameters in get_for_path() / best_match_for_path() …
Browse files Browse the repository at this point in the history
…manager methods
  • Loading branch information
vdboor committed Dec 30, 2014
1 parent a3e1fc4 commit c63a60c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions fluent_pages/models/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,22 +219,27 @@ def _get_queryset(self):
return self.get_query_set()


def get_for_path(self, path):
def get_for_path(self, path, language_code=None):
"""
Return the UrlNode for the given path.
The path is expected to start with an initial slash.
Raises UrlNode.DoesNotExist when the item is not found.
.. versionchanged:: 0.9 This filter only returns the pages of the current site.
"""
return self._get_queryset().get_for_path(path)
return self._get_queryset().get_for_path(path, language_code=language_code)


def best_match_for_path(self, path):
def best_match_for_path(self, path, language_code=None):
"""
Return the UrlNode that is the closest parent to the given path.
UrlNode.objects.best_match_for_path('/photos/album/2008/09') might return the page with url '/photos/album/'.
.. versionchanged:: 0.9 This filter only returns the pages of the current site.
"""
return self._get_queryset().best_match_for_path(path)
return self._get_queryset().best_match_for_path(path, language_code=language_code)


def get_for_key(self, key):
Expand Down

0 comments on commit c63a60c

Please sign in to comment.