-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Em 14-08-2013 15:23, hiro escreveu: > Without touching db.py I have created a new file in order to add another > database. > > I want to keep the auth data in the standard setup but keep other parts of my > data in a large and fast external database. > > The problem I am having is that I cannot reference between the databases. > > in my_new_db.py: > > external_db = DAL( > 'postgres://connection_string', > pool_size=10, > migrate=False > ) > > db.define_table( > 'thing1', > Field('name_of_thing1'), > Field(user_id, db.auth_user) > format = '%(name_of_thing1')s' > ) > > external_db.define_table( > 'thing2', > Field('name_of_thing2'), > Field(user_id, db.auth_user) > format = '%(name_of_thing2')s' > ) > > The first works fine but the second fail when I try to query from the thing2 > table i get the error: AttributeError: 'DAL' object has no attribute > 'auth_user' > > Is it possible to cross reference the databases? If so, how? >
Since you're using Postgresql, you can try dblink (http://www.postgresql.org/docs/8.3/static/dblink.html), as suggested here: http://stackoverflow.com/questions/46324/possible-to-perform-cross-database-queries-with-postgres - -- Com os melhores cumprimentos, Carlos Correia ========================= MEMÓRIA PERSISTENTE Tel.: 219 291 591 - GSM: 917 157 146 / 967 511 762 e-mail: ge...@memoriapersistente.pt - URL: http://www.memoriapersistente.pt Jabber: m...@jabber.org GnuPG: wwwkeys.eu.pgp.net URL Suporte: https://t5.m16e.com/gps -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Using GnuPG with undefined - http://www.enigmail.net/ iEYEARECAAYFAlILptUACgkQ90uzwjA1SJXDXgCcDYla5lxis3KrvPTAwTbICM0P Uh4AnRKEBUalCWrqev0LFHK4u+yjixV/ =/izj -----END PGP SIGNATURE----- -- --- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.