Sophie,
   I'm a Java programmer too, then I can help you !.

   First,

       In the file db.py you map your table, in this case the table
that the class StoreBean map. In this class(StoreBean) you have the
fields(properties) and the getters and setters to this fields.
       In Web2Py you don't need this, only define the table in db.py,
follow this sintaxe:

       For example:

       db.define_table('pampa_tabelapreco',
        Field('categoria',db.pampa_categoriacliente),
        Field('produto',db.pampa_produto),
        Field('preco','double', default='0.00'))
       db.pampa_tabelapreco.categoria.requires=IS_IN_DB(db,
'pampa_categoriacliente.id', 'pampa_categoriacliente.nome') /* This
map a relation */
db.pampa_tabelapreco.produto.requires=IS_IN_DB(db, 'pampa_produto.id',
'pampa_produto.nome_compra') /* This map a relation */
db.pampa_tabelapreco.categoria.label = T('Categoria de Cliente') //
This map the Labels to the Form.
db.pampa_tabelapreco.produto.label = T('Produto') // This map the
Labels to the Form.
db.pampa_tabelapreco.preco.label = T('Preço') // This map the Labels
to the Form.

  Second,

      In the Java Controller, you get the parameters of the request,
put this values in the bean and pass this bean to a DAO object.
      In Web2Py you don't need this !. In the controller (default.py
for example) you create a function that create a form of a table,
validate this form and save the data, all-in-one (yes !, Web2Py is a
excelent tool!), follow this sintaxe in your controller:

       def tabela_preco():
           ### create an insert form from the table
           form=SQLFORM(db.pampa_tabelapreco)
           ### if form is correct, perform the insert
           if form.accepts(request.vars,session):
              response.flash='new record inserted'
           return dict(form=form)

    Now, when you access this controller, the Web2Py generate a
Form !, try:

     http://127.0.0.1:8000/yourapp/defaul/tabela_preco

     This show the form with the fields of the table in a page !

     ps: Sorry by my terrible english ! .

 -- Leandro.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to