I've thought about this but I'm not sure how. Is there a hook/signal  
that gets fired when all models have been loaded but  
ModelBase._prepare hasn't run?

Erik

On 08.10.2008, at 16:38, Carl Meyer wrote:

>
>
>
> On Oct 8, 5:29 am, Erik Allik <[EMAIL PROTECTED]> wrote:
>> I'm writing a content management framework which stores content in a
>> tree of nodes. Nodes can be of different content types and I want to
>> be able to add new content types by simply adding apps that provide
>> models to INSTALLED_APPS. And I don't want these apps to be forced to
>> be aware of the existence of my content framework. Anyway, apps
>> normally define URLs/views for models, and that means I won't be able
>> to pull these models into my own URL hierarchy. So for that reason I
>> need to be able to override URLs of other apps' models.
>>
>> And here comes the problem I'm trying to solve: to be able to  
>> override
>> a models URL, I still need to know which view/args/kwargs it maps to
>> so I need to take the model's original URL, resolve it using the
>> model's containing app's URLconf, and then dynamically create a URL
>> pattern for the view/args/kwargs that the model's original URL
>> resolved to. But, by the time my custom URL resolver kicks in, the
>> ABSOLUTE_URL_OVERRIDES setting has already taken effect and there's  
>> no
>> way to find out which view/args/kwargs a model maps to any more.
>
> You could abandon ABSOLUTE_URL_OVERRIDES and just monkeypatch these
> other models' get_absolute_url methods yourself.  Kind of ugly, but
> much better than putting the ugly hack into your Django source tree.
>
> Carl
> >


--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to