When 'normal' web2py practice  defines a field as a reference like this:

 Field('created_by', db.auth_user, default = auth.user_id,
                           readable = False, writable = False)


, postgresql does something like this:


ALTER TABLE akb_articles
  ADD CONSTRAINT akb_articles_created_by_fkey FOREIGN KEY (created_by)
      REFERENCES auth_user (id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE CASCADE;

I use uuids, not ids for reference in a complex database.  How do I change 
my field definition which currently looks like this:

db.akb_journal.publisher.requires = IS_EMPTY_OR(IS_IN_DB(db,               
                                                       'akb_publisher.uuid',
'%(publisher)s'))



to produce a foreign key in Postgresql similar than the previous one?

Regards
Johann





Reply via email to