- This method will construct a URL based on the Node's location.
- If a request is passed in, that will be used as a backup in case
- the Site lookup fails. The Site lookup takes precedence because
- it's what's used to find the root node. This will raise:
- - NoReverseMatch if philo-root is not reverseable
- - Site.DoesNotExist if a domain is requested but not buildable.
- - AncestorDoesNotExist if the root node of the site isn't an
- ancestor of this instance.
+ This method will do its best to construct a URL based on the Node's location. If with_domain is True, that URL will include a domain and a protocol; if secure is True as well, the protocol will be https. The request will be used to construct a domain in cases where a call to :meth:`Site.objects.get_current` fails.
+
+ Node urls will not contain a trailing slash unless a subpath is provided which ends with a trailing slash. Subpaths are expected to begin with a slash, as if returned by :func:`django.core.urlresolvers.reverse`.
+
+ Because this method will be called frequently and will always try to reverse ``philo-root``, the results of that reversal will be cached by default. This can be disabled by setting :setting:`PHILO_CACHE_PHILO_ROOT` to ``False``.
+
+ :meth:`construct_url` may raise the following exceptions:
+
+ - :class:`NoReverseMatch` if "philo-root" is not reversable -- for example, if :mod:`philo.urls` is not included anywhere in your urlpatterns.
+ - :class:`Site.DoesNotExist <ObjectDoesNotExist>` if with_domain is True but no :class:`Site` or :class:`RequestSite` can be built.
+ - :class:`~philo.exceptions.AncestorDoesNotExist` if the root node of the site isn't an ancestor of the node constructing the URL.
+
+ :param string subpath: The subpath to be constructed beyond beyond the node's URL.
+ :param request: :class:`HttpRequest` instance. Will be used to construct a :class:`RequestSite` if :meth:`Site.objects.get_current` fails.
+ :param with_domain: Whether the constructed URL should include a domain name and protocol.
+ :param secure: Whether the protocol, if included, should be http:// or https://.
+ :returns: A constructed url for accessing the given subpath of the current node instance.
+