Re: RFC: Query Methods

2012-01-03 Thread Tai Lee
I have had difficulty in finding an easy way to add common methods to querysets and managers for multiple models in Django. I solved the problem in my projects by defining a custom `Manager` class which defines `use_for_related_fields = True` and also overrides `__getattr__()` to look for queryset

Reason behind hiding the template origin

2012-01-03 Thread Preston Timmons
Hi, I have a question for somebody more experienced with the Django template system internals. The template loader load_template method is documented as such: "The load_template() method of the Loader class retrieves the template string by calling load_template_source(), instantiates a Template

Re: RFC: Query Methods

2012-01-03 Thread Carl Meyer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/03/2012 10:42 AM, Alex Gaynor wrote: > I haven't analyzed your suggestion in detail Carl, but there is a good > reason for managers to exist: > querysets cache internally on iteration, managers are not directly > evaluable, but were they you cou

Re: RFC: Query Methods

2012-01-03 Thread Alex Gaynor
On Tue, Jan 3, 2012 at 11:43 AM, Carl Meyer wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hi Zachary, > > On 01/02/2012 10:55 PM, Zachary Voase wrote: > > At the moment it's very easy to add methods to individual models, just > > by putting a method on the model class itself which

Re: RFC: Query Methods

2012-01-03 Thread Carl Meyer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Zachary, On 01/02/2012 10:55 PM, Zachary Voase wrote: > At the moment it's very easy to add methods to individual models, just > by putting a method on the model class itself which accepts 'self'. > However, defining business logic on collections o

Re: notice: change in Trac emails behavior

2012-01-03 Thread Dalton Barreto
2012/1/3 Florian Apolloner : >> >> Would it be a good idea to use a cookie, so the plugin would >> "remember" what the user wants? or would it be too much? > > More like a preference or something similar would be needed… Indeed. But now the plugin start to become nontrivial. Maybe using the firs

Re: notice: change in Trac emails behavior

2012-01-03 Thread Florian Apolloner
On Tuesday, January 3, 2012 5:13:27 PM UTC+1, Dalton Barreto wrote: > > 2012/1/2 Florian Apolloner : > > This could work, but if the plugin checks the box on every request a > user that do not want to receive the updates must uncheck every time > he updates a ticket. > Yikes, good point. > Wo

Re: notice: change in Trac emails behavior

2012-01-03 Thread Dalton Barreto
2012/1/2 Florian Apolloner : > If trac doesn't allow to change this via the admin interface a simple plugin > should be enough (It's Genshi after all so we can alter the stream and just > check the box ;)). If this is the wanted behavior I could try writing a > plugin. This could work, but if the

Re: Proposal: make app index optional

2012-01-03 Thread Michel Thadeu Sabchuk
Hi Russ, > it would seem logical that improved > configurability of these views (e.g., making the "home" view > user-configurable) would be a logical outcome. In fact, I propose an configurable option to keep backward compatibility but, in a refactoring, I would suggest to get rid of the app inde

Re: RFC: Query Methods

2012-01-03 Thread Donald Stufft
I replied to the ticket, but I'll mention it here as well. django-model-utils has an implementation of something that achieves the same result. It was originally from http://paulm.us/post/3717466639/passthroughmanager-for-django and has since been added to https://github.com/carljm/django-model

Re: RFC: Query Methods

2012-01-03 Thread Zachary Voase
On Jan 3, 7:01 am, Russell Keith-Magee wrote: > On Tue, Jan 3, 2012 at 1:55 PM, Zachary Voase wrote: > > At the moment it's very easy to add methods to individual models, just > > by putting a method on the model class itself which accepts 'self'. > > However, defining business logic on collectio