Re: Atomic value increment

2006-07-12 Thread Don Arbow
On Jul 12, 2006, at 7:38 PM, Adrian Holovaty wrote: > > On 7/12/06, Jay Parlar <[EMAIL PROTECTED]> wrote: >> Is there a better way to do this? More specifically, an atomic way to >> generate and set the new unique_id? I can't just use the >> autogenerated >> 'id' primary key as an unique

Re: Atomic value increment

2006-07-12 Thread Adrian Holovaty
On 7/12/06, Jay Parlar <[EMAIL PROTECTED]> wrote: > Is there a better way to do this? More specifically, an atomic way to > generate and set the new unique_id? I can't just use the autogenerated > 'id' primary key as an unique identifier, because I have a list of > legacy unique_id values which I

Re: Atomic value increment

2006-07-12 Thread Jay Parlar
On 7/12/06, Ian Holsman <[EMAIL PROTECTED]> wrote: > > why not use a GUID ? > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/163604 That's pretty neat, but I do need the values to increase by one everytime. Jay P. --~--~-~--~~~---~--~~ You received this

Re: Atomic value increment

2006-07-12 Thread Ian Holsman
why not use a GUID ? http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/163604 On 13/07/2006, at 8:08 AM, Jay Parlar wrote: > > On 7/12/06, Don Arbow <[EMAIL PROTECTED]> wrote: >> >> On Jul 12, 2006, at 8:56 AM, Jay Parlar wrote: >>> >>> Is there a better way to do this? More specifically,

Re: Atomic value increment

2006-07-12 Thread Jay Parlar
On 7/12/06, Don Arbow <[EMAIL PROTECTED]> wrote: > > On Jul 12, 2006, at 8:56 AM, Jay Parlar wrote: > > > > Is there a better way to do this? More specifically, an atomic way to > > generate and set the new unique_id? I can't just use the autogenerated > > 'id' primary key as an unique

Re: Atomic value increment

2006-07-12 Thread Don Arbow
On Jul 12, 2006, at 8:56 AM, Jay Parlar wrote: > > Is there a better way to do this? More specifically, an atomic way to > generate and set the new unique_id? I can't just use the autogenerated > 'id' primary key as an unique identifier, because I have a list of > legacy unique_id values which I

Atomic value increment

2006-07-12 Thread Jay Parlar
I've got a model something like this: class Product(models.Model) name = models.CharField(...) unique_id = models.PostiveIntegerField(unique=True) Instances of this model are only ever created programatically from a view. My current (and awful) scheme for getting a new unique_id for a