On 3/28/06, pbx <[EMAIL PROTECTED]> wrote:
> I think rolling functionality similar to ABSOLUTE_URL_OVERRIDES into
> URLconfs is the way to go. As others have pointed out,
> get_absolute_url() doesn't cover enough ground and creates unnecessary
> coupling.

You realize that because ASOLUTE_URL_OVERRIDES takes arbitrary
functions you could do that today with no framework changes?  (Might
be something worthy of an addition to the body of shortcuts, though,
if someone comes up with a decent version.)

Off the top of my head (don't blame me if it has bugs):

def urlfromconf(object, path):
    urlconf = __import__(path)
    return urlconf.absolute_url(object)

ABSOLUTE_URL_OVERRIDES = {
    'myapp.somemodel': lamda o: urlfromconf(o, 'myapp.urls.somemodelrelated'),
}

Then in myapps.urls.somemodelrelated:

def absolute_url(object):
     return "/path/to/object/%s/" % (object.id)

--
--Max Battcher--
http://www.worldmaker.net/
All progress is based upon a universal innate desire on the part of
every organism to live beyond its income. --Samuel Butler

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to