Re: Decorator aware Django

2011-12-16 Thread Andre Terra
On Thu, Dec 15, 2011 at 8:17 PM, Bernardo wrote: > I still need to see how to combine multiple Class based views to treat > my data. > The idea here is to use Mixins, i.e., classes that implement a few methods and can be mixed with one of your main classes. #

Re: Decorator aware Django

2011-12-15 Thread Bernardo
> Use Class-based views[1] and subclass them as needed? Earlier today I saw a blog talking about that. I haven't read everything, but seems that it is what I want. I still need to see how to combine multiple Class based views to treat my data. Thanks! Bernardo On Dec 15, 3:48 pm, Andre Terra

Re: Decorator aware Django

2011-12-15 Thread Andre Terra
On Thu, Dec 15, 2011 at 11:51 AM, Bernardo wrote: > but I > wanted a easier way to render data from multiple return points in a > same function without calling another thing multiple times... > Use Class-based views[1] and subclass them as needed? Cheers, AT [1]

Re: Decorator aware Django

2011-12-15 Thread Bernardo
> @app.route("/") > def hello(): > return "Hello World!" That's not what I want to do. I like how views are handled, but I wanted a easier way to render data from multiple return points in a same function without calling another thing multiple times... > Now I have to overcome this feeling

Re: Decorator aware Django

2011-12-14 Thread Derek
On 14 December 2011 23:57, Matej Cepl wrote: > On 13.12.2011 15:14, Javier Guerra Giraldez wrote: >> >> for me, is opposed to the "explicit is better than implicit" in the >> Zen of Python.  not a bad thing on itself, but something to be careful >> about.   (and, personally,

Re: Decorator aware Django

2011-12-14 Thread Matej Cepl
On 13.12.2011 15:14, Javier Guerra Giraldez wrote: for me, is opposed to the "explicit is better than implicit" in the Zen of Python. not a bad thing on itself, but something to be careful about. (and, personally, it's a big part of why i like Django so much better than RoR) I am a complete

Re: Decorator aware Django

2011-12-13 Thread Bernardo
Hi Russel, > Returning HTTPResponse also provides a data formatting constraint that > your approach doesn't have. At each level of Django view, you know > you're going to get a HTTP Response. Yes, now it makes sense the view working only with HTTP request and responses and the decorators will

Re: Decorator aware Django

2011-12-13 Thread Javier Guerra Giraldez
hi, Russel explained the real reasons of why your proposal doesn't fit so good in Django. still, this snippet: On Mon, Dec 12, 2011 at 7:49 PM, Bernardo wrote: >        - The framework, within reason, should deduce as much as > possible from as little as possible. >    That

Re: Decorator aware Django

2011-12-12 Thread Russell Keith-Magee
On Tue, Dec 13, 2011 at 8:49 AM, Bernardo wrote: > One thing the project I was working had and I liked was lots of > decorators on top of controllers (what you people call views - and > makes sense) > Something like that: > > #- > >

Decorator aware Django

2011-12-12 Thread Bernardo
I've been working lately (not my choice!) with Pylons and the terrible Genshi as template system. The thing is: for the next project I wanted to use something better and the first thing I could think of was Django. I spent the last weaks reading documentation (FAQs, installation, templates,