On Sun, May 3, 2009 at 7:32 PM, dlypka <[email protected]> wrote: > > because **inside** the crud() call I believe it (magically) does > this kind of stuff: > > def test(): > f = FORM('Is web2py cool? Why?', > SELECT(OPTION('Yes', _value='y'), OPTION('No', > _value='n'), _name='opts', requires=IS_IN_SET(['y'], > error_message='Errr...wrong answer')), > INPUT(_type='text', _name='why', _value="'cause python > rules", requires=IS_NOT_EMPTY()), > INPUT(_type='submit', _name='btnSubmit', _value='ok')) > if f.accepts(request.vars): > response.flash = 'form accepted' > elif request.vars.btnSubmit: > response.flash = 'error in form' > return dict(myform=f, v=request.vars) > > > so in particular crud() generates those INPUT objects for you, and the > INPUT object is the thing which > creates the error attribute inside that INPUT object instance which > then satisfies 'hasattr()' So I believe the solution for you is to > make an INPUT call yourself within the markup, in {{ }} (somehow). > Probably we need to modify the INPUT class Python code > to support that. Basically you need to bind your own instance of an > INPUT class, to the part of your form where you need the <input> tag.
Crud uses SQLFORM to generate forms and SQLTABLE to present data. See gluon/tools.py, class Crud and tools/sqlhtml.py, classes SQLFORM and SQLTABLE. -- Álvaro Justen Peta5 - Telecomunicações e Software Livre 21 3021-6001 / 9898-0141 http://www.peta5.com.br/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" 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/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

