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 entire request, so if multiple 
> records are inserted during the request, they will all get the same uuid. 
> Instead, you can do default=uuid.uuid4 or default=lambda: uuid.uuid4() -- 
> in those cases, the default is a callable rather than a fixed value, and 
> the callable will be called separately for each record inserted, thereby 
> generating a new value for each record.
>
> Anthony
>

-- 



Reply via email to