please do:
db.define_table('person',Field('person_uuid', notnull=True,
writable=False, unique=True))
db.person.person_uuid = lambda:str(uuid.uuid4())
from gluon.contrib.populate import populate
populate(db.person, 50)
else the default is set the same for all records.
On Mar 31, 1:49 am, niknok <[email protected]> wrote:
> On Web2Py v 1.94.5:
>
> db.define_table('person',Field('person_uuid', notnull=True,
> default=uuid.uuid4(), writable=False, unique=True))
>
> from gluon.contrib.populate import populate
> populate(db.person, 50)
>
> Calling contrib.populate generates an error: "IntegrityError: column
> person_uuid is not unique" because it doesn't create the necessary uuid
> for each record it creates for said table. I tried it without the
> 'unique=True' parameter and records are generated but all the records
> share the same uuid.