Re: Loading Backends

2009-12-21 Thread Marty Alchin
On Mon, Dec 21, 2009 at 10:46 AM, Simon Willison
 wrote:
> On Dec 21, 2:22 pm, Marty Alchin  wrote:
>> Looking over Simon's patch for signed cookies, I noticed that yet
>> another feature needs to write its own "load a backend from a setting"
>> function.
>
> Yup - and as I copied and pasted it from somewhere else I thought
> exactly the same thing. Is this kind of refactoring something we can
> do after the 1.2 feature freeze? If so I think it would be worth
> cleaning up at least some of this stuff.

Absolutely, this is completely separate from anything that should
affect the feature freeze. As Russ pointed out, there are a lot of
different of this backend loading stuff, so it'll be tricky to figure
out just how much can/should be factored out, how to deal with some of
the variations and how to recommend people do it going forward. In
fact, it's not even something that needs to happen by the 1.2 release
at all, if more time is necessary to get it right. It's less than
ideal at the moment, but I'd say practicality beats purity in this
case, to make sure we can get the goods out the door.

-Marty

--

You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@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.




Re: Loading Backends

2009-12-21 Thread Simon Willison
On Dec 21, 2:22 pm, Marty Alchin  wrote:
> Looking over Simon's patch for signed cookies, I noticed that yet
> another feature needs to write its own "load a backend from a setting"
> function.

Yup - and as I copied and pasted it from somewhere else I thought
exactly the same thing. Is this kind of refactoring something we can
do after the 1.2 feature freeze? If so I think it would be worth
cleaning up at least some of this stuff.

Cheers,

Simon

--

You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@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.




Re: Loading Backends

2009-12-21 Thread Russell Keith-Magee
On Mon, Dec 21, 2009 at 10:39 PM, Jeremy Dunck  wrote:
> On Mon, Dec 21, 2009 at 8:22 AM, Marty Alchin  wrote:
> ...
>> django.contrib.auth.load_backend()
>> django.core.files.storage.get_storage_class()
>> django.template.loader.find_template_loader()
>> django.db.load_backend()
>
> Also, django.core.cache.get_cache

Also django.core.email, django.contrib.messages,
django.contrib.sessions... the list goes on.

The difficulty is that they aren't all exactly the same:

 * The email backend loader take arguments that configure the
underlying mail connection

 * The cache backend needs to handle a URI-style definition.

 * The template loaders need to have fallback support for old-style
template loaders, as well as handling checks for whether the loader is
available in the current environment.

Similar eccentricities exist in many of the backends.

In short - yes, factoring this out into a common utility is desirable.
However, it's a lot easier said than done.

Yours,
Russ Magee %-)

--

You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@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.




Re: Loading Backends

2009-12-21 Thread Jeremy Dunck
On Mon, Dec 21, 2009 at 8:22 AM, Marty Alchin  wrote:
...
> django.contrib.auth.load_backend()
> django.core.files.storage.get_storage_class()
> django.template.loader.find_template_loader()
> django.db.load_backend()

Also, django.core.cache.get_cache

--

You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@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.