On Sep 22, 2006, at 7:01 PM, Kevin Horn wrote: Sorry to interrupt... ;) I think He meant something like: from tg.validators import Int @validate(validator=dict(a=Int, b=Int, c=Int)) def quadratic(self, **kw): a = kw.get('a'); b= .... root = math.sqrt((b ** 2) - (4 * a * c)) return ((-b + root)/2a), ((-b - root)/2a)) I personally tend to mix both named vars and kwds depending on the case. For example, control variables I name, data that gets thrown at a SO or SA mapped class I stuff in kwds for easier passing. Example: def save(self, again=False, preview=False, **kw): new = Whatever(**kw) session.save(new) flash("A new Whatever was created, beware") if again: return redirect('Whatever.url_for('add')) if preview: return redirect(new.url_for('preview')) return redirect ('./') Alberto --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears -~----------~----~----~----~------~----~------~--~--- |
- [TurboGears] Re: Form variable best practice: named argu... Chris
- [TurboGears] Re: Form variable best practice: named... Jorge Godoy
- [TurboGears] Re: Form variable best practice: named... Jorge Godoy
- [TurboGears] Re: Form variable best practice: n... Kevin Horn
- [TurboGears] Re: Form variable best practic... Alberto Valverde
- [TurboGears] Re: Form variable best pra... Jeff Marshall
- [TurboGears] Re: Form variable bes... Jorge Godoy
- [TurboGears] Re: Form variable best pra... [EMAIL PROTECTED]
- [TurboGears] Re: Form variable best practic... Jorge Godoy

