Hi,
I am trying to define table with foreign key to the table stored in
different database on same server  (MySQL).

db_sys # db_sys on localhost mysql
db_cs # db_cs on localhost mysql

db_sys.define_table('item',
  Field('id_producer', db_sys.producer, requires=IS_IN_DB(db_sys,
'producer.id', '%(name)s (%(id)s)', error_message=T('Vyrobce neni v
databazi'))),
  Field('catalogue_no', 'string', label=T('Katalogove cislo'),
notnull=True),
  Field('name', 'string', label=T('Polozka (interne)'))
)

db_cs.define_table('item',
  Field('title', 'string', label=T('Nazev')),
  Field('description', 'text', label=T('Popis'))
)

after execution I get:
....sql.py", line 1576, in _create_references
 SyntaxError: Table: table "item" does not exist

I quick-check sources and I thing that there is not too much work to
make it work fine. Am I wrong? Is there different way?

thx

Reply via email to