Changes between Version 5 and Version 6 of ReplacingGetAbsoluteUrl
- Timestamp:
- Aug 12, 2008, 3:09:14 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ReplacingGetAbsoluteUrl
v5 v6 85 85 I'm currently leaning towards two complementary methods: 86 86 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/" 89 89 90 90 Users 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().