Dynamically Altering Settings

2008-12-01 Thread Kyle Fox
I needed a way to alter settings at runtime, based on the current Site. The method I came up with appears to work, but certainly doesn't feel elegant and (I'm sure) could use improvement. I'm going to share my reasoning behind dynamic settings in the hopes that it sparks some discussion about ho

Re: Proposal: deprecate and remove django.utils.simplejson

2008-12-01 Thread zvoase
I think a better approach would be to have django.utils.simplejson as a sort of alias package (which is easy using Python's introspection). What would happen is this: A user imports either django.utils.simplejson, or something from inside it. We look for the 'json' package on the path (Python 2.6

Re: logout() method for custom authentication backends

2008-12-01 Thread James Bennett
On Mon, Dec 1, 2008 at 8:10 AM, David Reynolds <[EMAIL PROTECTED]> wrote: > That doesn't help if you want to continue using the login/logout views > from django.contrib.auth.views Since you can drop callables directly into URL patterns, you can write a decorator which does what you need, import t

Re: logout() method for custom authentication backends

2008-12-01 Thread David Reynolds
On 1 Dec 2008, at 12:27, Julien Phalip wrote: > I think you could achieve that without patching Django. You could > simply create a custom view which wraps around auth.logout and calls > your other method. That doesn't help if you want to continue using the login/logout views from django.cont

Re: logout() method for custom authentication backends

2008-12-01 Thread Julien Phalip
On Dec 1, 11:07 pm, David Reynolds <[EMAIL PROTECTED]> wrote: > On 1 Dec 2008, at 11:49, David Reynolds wrote: > > I have a custom authentication backend that requires a method to be > > run to log out of the system.  It would be quite useful if there was a > > way > > to hook into the django.cont

Re: logout() method for custom authentication backends

2008-12-01 Thread David Reynolds
On 1 Dec 2008, at 11:49, David Reynolds wrote: > > I have a custom authentication backend that requires a method to be > run to log out of the system. It would be quite useful if there was a > way > to hook into the django.contrib.auth.logout method to run this custom > method. > > The best way

Re: Proposal: deprecate and remove django.utils.simplejson

2008-12-01 Thread David Cramer
I have nothing against removing it from the built-in libs, but as long as we look for the system's libraries first what's the big downside to keeping it? On Dec 1, 5:02 am, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On Mon, Dec 1, 2008 at 4:21 PM, James Bennett <[EMAIL PROTECTED]> wrote:

logout() method for custom authentication backends

2008-12-01 Thread David Reynolds
I have a custom authentication backend that requires a method to be run to log out of the system. It would be quite useful if there was a way to hook into the django.contrib.auth.logout method to run this custom method. The best way I can think of is to add a logout method to the authen

Re: Proposal: deprecate and remove django.utils.simplejson

2008-12-01 Thread Russell Keith-Magee
On Mon, Dec 1, 2008 at 4:21 PM, James Bennett <[EMAIL PROTECTED]> wrote: > > On Mon, Dec 1, 2008 at 12:45 AM, Russell Keith-Magee > <[EMAIL PROTECTED]> wrote: > I guess the thing that's bugging me is that this mostly seems to come > down to historical inertia; we already have simplejson in Django,