On Tue, 2008-10-07 at 14:49 +0300, Erik Allik wrote:
> Hi everybody,
> 
> I need a way to access a model's original get_absolute_url after the  
> ABSOLUTE_URL_OVERRIDES settings has taken effect. Currently I've  
> patched Django for this need so it will always alias the existing  
> get_absolute_url method as old_get_absolute_url when it overrides that  
> method, but patching stuff is ugly and poses deployment/reusability/ 
> upgradability issues, so I'm thinking maybe there's a hook or a signal  
> that I could use to achieve the same effect.
> 

No, you can't do that. The get_absolute_url method on the model is
entirely replaced. The former version is an ex-parrot, so to speak
(okay, I'm implicitly ruling out bytecode hacks to get at it, but
hopefully, so are you).

This does hint that you're using the wrong shovel to hammer in your
screws, however. You've said that you want to change that URL, always.
Hence it's in ABSOLUTE_URL_OVERRIDES. Later you are effectively saying
"no, just joking... I don't want it overridden all the time". If it's
only meant to be changed sometimes, the ABSOLUTE_URL_OVERRIDES is not
the right tool for the job.

What is the real problem you are trying to solve?

Malcolm



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