Re: A generic cache decorator around low level cache api

2023-01-04 Thread Diederik van der Boor
You’d mean something like this (for inspiration)? https://gist.github.com/vdboor/80e5ffa148fb30d33d938593855af9ac This would give the simplicity of using a @cache_results decorator, while allowing to bypass or refresh the cache when needed. I’m not sure but likely there are some packages that ha

Re: New `pre_handler()` method on Class-Based Views

2016-04-06 Thread Diederik van der Boor
Too bad the issue was already closed. I’ve added my 2 cents: https://github.com/django/django/pull/6416#issuecomment-206301186 I’d expect having a View.setup() method would simplify things for both simple use case and complex projects. Best, Diederik > Op 5 apr. 2016, om 15:20 heeft Tim Graham

Re: About Understanding of source code

2013-01-07 Thread Diederik van der Boor
Hi, What I find really valuable is using a editor/tool that allows you to jump to class/method/function definitions. I'm using PyCharm for Django development and it really helps me to dive into Django code (Cmd+Click on a symbol). Greetings, Diederik Op 7 jan. 2013, om 05:57 heeft Mayur Patil

Re: Class based views: A standard hook for http-method-independent code

2012-11-12 Thread Diederik van der Boor
Op 9 nov. 2012, om 07:05 heeft Russell Keith-Magee het volgende geschreven: > What I don't understand is why the need for an init() method isn't being > challenged in the first place. > > Why on earth can't just just take the logic that you're putting in init(), > and put it *in dispatch()*. T

Re: Class based views: A standard hook for http-method-independent code

2012-11-08 Thread Diederik van der Boor
Op 7 nov. 2012, om 17:49 heeft Aaron Merriam het volgende geschreven: > I wanted to post and modified version of a gist posted earlier in this thread. > > https://gist.github.com/4032482 > > I originally implemented the original structure of having an `init` hook > which was called between set

Re: Class based views: A standard hook for http-method-independent code (and a proposal for an init() method)

2012-10-31 Thread Diederik van der Boor
Hi, Please allow me to add my €0.02. In a large project I've experienced a similar issue; and we solved it in a slightly different way. What we also noticed was: - overriding dispatch(), get() or post() wasn't good enough anymore. - the views need some initialization moment before their workflow

Bug with contenttypes when models are removed - what approach to take?

2011-12-24 Thread Diederik van der Boor
Hi, I've encountered a bug with the contenttypes framework when a model is removed. You'll end up with a AttributeError in _add_to_cache(): 'NoneType' object has no attribute '_meta' That's because the ContentType still exists, byt ContentType. I would like to solve it, yet I'm not sur