get_absolute_url isn't nice
|Reported by:||ian@…||Owned by:||adrian|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
now by this I mean the application should not be required to know where it is installed.
get_absolute_url forces the object to know the URL path it is coming in on.
what might be nicer would be a get_relative_url which would return the part of the URL that the app is resposible for.
so take this URL for an example
I'm guessing that there is a 'news' app configured here with a 'story' table inside of it.
what would be nice is if the 'story' could return '/2005/oct/15/serenity/' and have the framework 'know' that it should be prefixing that with '/news'. It could get this information out of the URL pattern couldn't it?
and thanks for writing django
Change History (27)
comment:21 Changed 10 years ago by anonymous
- Summary changed from get_absolute_url isn't nice to get_absolute_url isn't nice$
comment:22 Changed 10 years ago by anonymous
- Summary changed from get_absolute_url isn't nice$ to get_absolute_url isn't nice