IRRC Workaround are:
 * redesign the database to avoid circular references
 * don't use circular references at all, they aren't really required
by web2py DAL, you can define tables without "references" feild types,
just normal ones, and use validators  (you can add foreign key
constraints later by SQL)
 * use circular references but no automatic migrations (migrate=False)

Anyway, there is no easy way in PostgreSQL (and possibly other "real"
databases too) to create circular references the way web2py does,
you'll need to execute SQL to properly create tables, populate them
and create foreing key constraints.
You can use db.executesql for this, and look for a standard postgresql
backup to see the required commands and correct steps.

Best regards,

Mariano Reingart
http://www.sistemasagiles.com.ar
http://reingart.blogspot.com



On Mon, Jun 13, 2011 at 5:17 PM, Carlos <carlosgali...@gmail.com> wrote:
> Hi Mariano,
> Thanks for your input.
> I would like a generic and automated web2py solution for circular references
> that works with all supported dbs (not only postgresql).
> I thought this was already supported in web2py, which is why I was asking
> also to Massimo (pending his confirmation / correction)?.
> Can you please give a quick example of the easy workarounds you mention to
> do via web2py (preferably generic and automated)?.
> Thanks again,
>    Carlos
>

Reply via email to