On 1/11/07, James Bennett <[EMAIL PROTECTED]> wrote: > > On 1/10/07, Joseph Kocherhans <[EMAIL PROTECTED]> wrote: > > I propose to register and lookup backends by name to fix this > > problem. Here's a configuration sample: > > > > # a tuple of (name, path) tuples > > AUTHENTICATION_BACKENDS = ( > > ('default', 'django.contrib.auth.backends.ModelBackend'), > > ('ldap', 'mypkg.backends.LDAPBackend'), > > ) > > Other than the fact that it's currently a tuple, is there any reason > not to change this to a dictionary? That'd feel cleaner and make it > much easier to do lookups against it (no more iterating through tuples > of tuples): > > # a dictionary of name/path pairs > AUTHENTICATION_BACKENDS = { > 'default': 'django.contrib.auth.backends.ModelBackend', > 'ldap': 'mypkg.backends.LDAPBackend', > }
I'd love to use a dictionary, but the order of backends matters. I wish python had a decent syntax for what basically amounts to an ordered dict. Joseph --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---