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
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
-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
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
-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
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
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
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
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
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
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
11 matches
Mail list logo