On Thu, Sep 10, 2009 at 11:23 AM, drozzy <dro...@gmail.com> wrote: > > Just read the "Replacing get_absolute_url proposal": > http://code.djangoproject.com/wiki/ReplacingGetAbsoluteUrl > > and personally I think adding two functions get_url_path and get_url > is a lot more confusing. One can never remember which one gets the > Absolute url and which one gets the Relative url.
Easy, get_url returns the entire url while get_url_path returns only the "path" portion of a url. One could imagine feature creep resulting in 'get_url_protocol', 'get_url_domain' etc. I wouldn't actually recommend those be added, but by thinking about it that way, it trains my brain how to parse the proposed function names. > If it is going to be done I propose adding another function, and thus > have two possible functions on the model: > get_relative_url > get_absolute_url That seems like the obvious solution except that get_absolute_url currently returns a url path. Oops! With the change, everyone's existing code will suddenly break. The only way to fix it is to depreciate get_absolute_url and create new names for the replacements. Oh, and this reference to relative urls. Relative to what? The site root? The app root? The currently viewed page? "get_relative_url" is probably not what you actually want. "get_url_path" is. Of course, this all really a bikeshed issue. Generally, 'he who builds the shed gets to paint it.' -- ---- \X/ /-\ `/ |_ /-\ |\| Waylan Limberg --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---