Thanks for all answers.
I put an example about I want to do:
In db.py I define 2 databases:
db= DAL('mssql://SQL SERVER DATABASE') #db is a SQL Server database
doesn't created with web2py
db2 = DAL('mssql://SQL SERVER DATABASE') #db2 is a SQL Server database
created with web2py
#Below are some of the tables I need:
db.define_table('personal_personal',
Field('id_personal', 'id'), # Primary key, not
auto-increment
Field('nombre', 'string', length=40,
requires=IS_LENGTH(40), notnull=False),
migrate=False
)
db2.define_table('unidades',
Field('nombre', length=100, requires=IS_LENGTH(100),
notnull=False),
Field('descripcion', length=250, requires=IS_LENGTH(250),
notnull=True),
Field('operador'),
format='%(operador)s'
)
In a controller I have the following code:
def nueva_unidad():
form=SQLFORM(db2.unidades, submit_button="Aceptar")
if form.accepts(request.vars, session):
redirect(URL(r=request, f='nueva_unidad'))
response.flash = 'Se ha creado una nueva unidad'
return dict(form=form)
I wish to load the content of field nombre (table personal_personal) in the
field operador of the table unidades. Is this possible?
Please excuse my english, is not very good.
Regards
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.