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. On Tue, Sep 15, 2009 at 2:55 AM, James Bennett <ubernost...@gmail.com> wrote: > > On Mon, Sep 14, 2009 at 12:45 PM, Patrick J McNerthney > <pmcnerth...@clearpointmetrics.com> wrote: >> I am new to Django and am deep in the middle of my first major project >> using Django. When I encountered get_absolute_url, my reaction was, >> "What were they thinking!". Why does the model have any knowledge about >> it's presentation? What if that very same model object is used for two >> completely separate purposes in two different applications? > > Then you'd want something more complicated to handle that. But, > really, "where does this object live" is a question the object itself > ought to be able to answer. One can argue endlessly about the name, > API, return values, etc., etc., but the fact remains that there's a > valid problem whose valid solution is "ask the object". And so, like > Jacob, I'd really like to start seeing actual *code* to try to improve > the way that gets done, rather than the endless bikeshedding this > thread seems to be headed for. > > > -- > "Bureaucrat Conrad, you are technically correct -- the best kind of correct." > > > > -- Best regards, Yuri V. Baburov, ICQ# 99934676, Skype: yuri.baburov, MSN: bu...@live.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---