kike: Antes que nada, hay un grupo de usuarios en español: http://groups.google.com/group/web2py-usuarios (web2py-users es para consultas en inglés)
Respecto a tu problema, ¿donde estas definiendo la tabla object_vendors? En el grupo en español se trato algo similar sobre como usar varias bases distintas: http://groups.google.com/group/web2py-usuarios/browse_thread/thread/6cb57d99806b5ba0 Sds Mariano Reingart http://reingart.blogspot.com On Sat, Mar 20, 2010 at 3:01 PM, kike <[email protected]> wrote: > disculpenme en donde dice: > auth_table.preference.requires=IS_NOT_EMPTY() > auth_table.second_preference=IS_NOT_EMPTY() > > realmente dice: > > auth_table.preference.requires=IS_IN_DB(vul,'object_vendors.id','object_vendors.name') > auth_table.second_preference=IS_IN_DB(vul,'object_products.id','object_products.name') > > On 20 mar, 12:55, kike <[email protected]> wrote: >> tengo dos bases de datos distintas, la primera es la que se basa mi >> aplicacion, y la segunda es la que crea auth, el problema es que >> cuando le digo a auth que coja la informacion de un campo de la >> primera base de datos, me dice que no conoce el nombre, aqui les pongo >> el codigo y el error: >> >> vul=DAL('mysql://root:r...@localhost/sbdv',pool_size=20) >> db = DAL('mysql://root:r...@localhost/usbdv',pool_size=20) >> >> from gluon.tools import * >> auth=Auth(globals(),db) >> auth.settings.hmac_key='sha512:582aedbf-4d01-4f41-81ad-ffb7eed2ada4' >> auth_table=db.define_table( >> auth.settings.table_user_name, >> Field('first_name', length=128, label='Nombre(s)'), >> Field('last_name', length=128, label='Apellidos'), >> Field('email', length=128, unique=True, label='Correo'), >> Field('password', 'password', length=256, readable=False, >> label='Contraseña'), >> Field('registration_key', length=128, writable=False, >> readable=False), >> Field('preference', vul.object_vendors.name, label='Preferencia >> Principal'), >> Field('second_preference', vul.object_products.name, >> label='Preferencia Secundaria')) >> >> auth_table.first_name.requires=IS_NOT_EMPTY() >> auth_table.last_name.requires=IS_NOT_EMPTY() >> auth_table.password.requires=[CRYPT()] >> auth_table.email.requires=[IS_EMAIL(), IS_NOT_IN_DB(db, >> auth_table.email)] >> auth_table.preference.requires=IS_NOT_EMPTY() >> auth_table.second_preference=IS_NOT_EMPTY() >> auth.settings.table_user=auth_table >> auth.define_tables() >> >> Traceback (most recent call last): >> File "/home/kike/sbdv/web2py/gluon/restricted.py", line 173, in >> restricted >> File "/home/kike/Desktop/web2py/applications/SBDV/models/db.py", >> line 40, in <module> >> Field('preference', vul.object_vendors.name, label='Preferencia >> Principal'), >> File "/home/kike/tesis/sbdv/web2py/gluon/sql.py", line 1295, in >> __getattr__ >> KeyError: 'object_vendors' > > -- > You received this message because you are subscribed to the Google Groups > "web2py-users" 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. > > -- You received this message because you are subscribed to the Google Groups "web2py-users" 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.

