On Mon, Sep 14, 2009 at 6:58 PM, Patrick J McNerthney
<pmcnerth...@clearpointmetrics.com> wrote:
>
> 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.
>

If the objective is to seperate the two systems why is having the URL
system know about Models more acceptable than having the Model system
know about URLs?  This is most certainly a bike shed IMO.

Alex

> 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.
>>
>>
>
>
> >
>



-- 
"I disapprove of what you say, but I will defend to the death your
right to say it." -- Voltaire
"The people's good is the highest law." -- Cicero
"Code can always be simpler than you think, but never as simple as you
want" -- Me

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to