We are not (at least not now), endless discussing the color to paint the bike shed, we are discussing the fact that the bike shed is being built in entirely the wrong location. IMO, the proper place to build this particular bike shed is in the urlresolvers section of the city, not in the models section.
Just like urlresolvers right now has a "reverse" method that can take in a view name, a similar method should be exposed that takes in a object. Something like: urlresolvers.reverse_for_object(object) In addition, most, if not all, of the current optional reverse arguments probably should be supported. Obviously, there are a few details to work out with regards to how to nicely configure the url resolvers sub-system to support this, but I believe that is where the bike shed belongs. Pat McNerthney ClearPoint Metrics, Inc. Yuri Baburov wrote: > This is kind of incorrect question by itself. > It's MVC pattern you're trying to overcome with this sort of question. > > Model is not living anywhere on site! > Admin app instance ("View" and "Controller") is one that allows you to > manage specific model instances ("Model") and make guesses what's the > meaning of these models. > Admin app should have that get_object_url for the link "View on site" > if it needs to show that. > (Usually, it can use reverse for that). > You can subclass ModelAdmin to override get_object_url behaviour. > You can't override models easily without monkeypatching (subclassing > makes new model or you deal with model proxies only to override > get_object_url), that's why ABSOLUTE_URL_OVERRIDES hook was born. > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---