Hi all, I would like your opinion on the following matter. There are currently two document store adapters in web2py. CouchDB and Mongodb, both still highly experimental.
Now would it be nice if there was a way in which we could define embedded documents in a way that is still compatible with SQL. My first thoughts on this topic are that we could map them like this. db.define_table("MAIN",FIELD("subdoc","reference SUBDOC",embed=True)) db.define_table("SUBDOC",FIELD("one",'string') De SQL databases will solve this with a one-many table relation and the document store will embed it. But this definition leaves room for mistakes. - The definition could embed the same subdoc twice, which will work in the document store, but not in web2py. - The statement would be implemented in alle SQL adapers - A definition before the main document will lead to troube My alternative thoughts on this are like this. Fields= [FIELD('fieldone','string',notnull=True),FIELD('fieldtwo','string',notnull=True)] db.define_table("MAIN",FIELD("subdoc","define_table SUBDOC",Fields)) Again the field gets embedded on document stores and translated into one-many relationship for SQL stores. You're comments, ideas or critics please. regards Mark Breedveld,