Re: [web2py] @make_member_of() decorator

2013-05-02 Thread Ricardo Pedroso
Ok, never mind. I did a quick test. My concerns are already protected :) The test was: @make_member_of(db.auth_user, 'insert') and this raises a SyntaxError by __setattr__ of Table class. Regards, Ricardo On Thu, May 2, 2013 at 3:07 PM, Vinicius Assef wrote: > Ricardo, not, in my oppinion.

Re: [web2py] @make_member_of() decorator

2013-05-02 Thread Vinicius Assef
Ricardo, not, in my oppinion. First, because this approach is used by a developer, who knows how table columns are named. He owns the source code, right? ;-) Second, because it's designed to be used mainly in models/ files, to organize methods of a table. Again, we face the 1st point, above.

Re: [web2py] @make_member_of() decorator

2013-05-02 Thread Ricardo Pedroso
On Wed, May 1, 2013 at 10:34 PM, Vinicius Assef wrote: > I created a decorator to allow binding a function to a Table instance. > > IMHO, this helps organizing models, creating something similar to > Django's managers. > > To an example, see: https://gist.github.com/viniciusban/5497532 > > To get