Changes between Version 5 and Version 6 of ReplacingGetAbsoluteUrl


Ignore:
Timestamp:
08/12/2008 03:09:14 PM (7 years ago)
Author:
simon
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ReplacingGetAbsoluteUrl

    v5 v6  
    8585I'm currently leaning towards two complementary methods:
    8686
    87 * '''get_url_path()''' - returns the URL's path component, starting at the root of the site - e.g. "/blog/2008/Aug/11/slug/"
    88 * '''get_url()''' - returns the full URL, including the protocol and domain - e.g. http://example.com/blog/2008/Aug/11/slug/"
     87 * '''get_url_path()''' - returns the URL's path component, starting at the root of the site - e.g. "/blog/2008/Aug/11/slug/"
     88 * '''get_url()''' - returns the full URL, including the protocol and domain - e.g. http://example.com/blog/2008/Aug/11/slug/"
    8989
    9090Users should be able to define either or both of these methods. If they define one but not the other, the default implementation of the undefined method can attempt to figure it out based on the method that IS defined. This should actually work pretty well - get_url_path() is trival to derive from get_url(), whereas for sites that only exist on one domain get_url() could simply glue that domain (defined in settings.py, or derived from SITE_ID and the sites framework) on to get_url_path().
Back to Top