[web2py] Re: Using UUID in a many to many database

2012-07-28 Thread Mark Li
Thanks for the tip Anthony On Saturday, July 28, 2012 12:28:15 PM UTC-7, Anthony wrote: > > db.define_table('people', >> Field('uuid', length=64, default=uuid.uuid4() >> > > Note, you may not want to set default=uuid.uuid4() -- that will set the > default to a single fixed uuid value for the enti

[web2py] Re: Using UUID in a many to many database

2012-07-28 Thread Anthony
> > db.define_table('people', > Field('uuid', length=64, default=uuid.uuid4() > Note, you may not want to set default=uuid.uuid4() -- that will set the default to a single fixed uuid value for the entire request, so if multiple records are inserted during the request, they will all get the same

[web2py] Re: Using UUID in a many to many database

2012-07-27 Thread Massimo Di Pierro
You can't. References are always by ID. You can use the IS_IN_DB to show the UUID instead of the ID but the database will continue to use the ID. The presence of the UUID will be used by db.import_from_csv_file to fix references when importing records because it will build a temporary dictionar