On 03/03/2012, at 7:34 AM, Carl Meyer wrote:
> Hello Artem,
>
> On 03/02/2012 03:04 PM, Артем Рыжов wrote:
>> I'm working as a web developer for many years. One of the most frequent
>> tasks
>> is sending email messages. And template system is very usefull for this task
>> as for web pages. I
Hello Artem,
On 03/02/2012 03:04 PM, Артем Рыжов wrote:
> I'm working as a web developer for many years. One of the most frequent tasks
> is sending email messages. And template system is very usefull for this task
> as for web pages. It's strange, but I have not found builtin support for
> ema
Hello dear Django developers!
I'm working as a web developer for many years. One of the most frequent tasks
is sending email messages. And template system is very usefull for this task
as for web pages. It's strange, but I have not found builtin support for email
templates on many platforms tha
That's not the case - get_context_data, get_queryset, are examples of hooks
like this preprocess one, not places where more would be added. I'm not
sure if there's a better analogy.
Overriding the dispatch method would be the correct solution if you wanted
to behave the same towards all methods, b
Then that would also be the case for many other methods in generic
class-based views, like get_context_data, get_queryset, etc.. I hate
boilerplate code as much as the next guy, but I'm not sure I follow why
this single method would get a special hook. Correct me if I'm wrong, but
special cases are
That's true, but I agree it seems a useful enough hook to make it a hook,
rather than needing to do it yourself like that. I would vote for it being
called 'preprocess', to make it clear that it's both optional and run
before the method-specific function.
- ojno
On 2 March 2012 13:40, Michael van
Hi,
This should already be quite easy to implement, do something like:
def dispatch(self, *args, **kwargs):
# Some code
return super(YourView, self).dispatch(*args, **kwargs)
Regards,
Michael
On Fri, Mar 2, 2012 at 11:58, Charlie "meshy" Denton
wrote:
> I would like to see
I would like to see something like this too. I my suggestion is here:
https://gist.github.com/1957251
This method has two advantages:
1. You can modify the request, args, and kwargs before they get saved to
the view.
2. You can execute code after request, args, and kwargs are saved but
before t
I'd like to see something like this too: my suggestion is here:
https://gist.github.com/1957251
This implementation also allows you to play with the request, args and
kwargs before they are saved on the model.
On Mar 1, 6:38 pm, Marc Tamlyn wrote:
> Hi all,
>
> Apologies if this has been raised