Re: getting unique id

2022-11-28 Thread Larry Martell
On Wed, Nov 23, 2022 at 3:11 PM Larry Martell wrote: > > On Wed, Nov 23, 2022 at 3:01 PM Thomas Lockhart > wrote: > > > > Why not use the existing Django AutoField? > > Because I have multiple rows with the same batch_id, and also I would > like the batch_ids to be sequential. > > The use case

Re: getting unique id

2022-11-23 Thread Larry Martell
On Wed, Nov 23, 2022 at 3:01 PM Thomas Lockhart wrote: > > Why not use the existing Django AutoField? Because I have multiple rows with the same batch_id, and also I would like the batch_ids to be sequential. The use case is a batch job dashboard. Users run jobs that spawn many sub jobs. The

Re: getting unique id

2022-11-23 Thread Larry Martell
On Wed, Nov 23, 2022 at 1:43 PM Shaheed Haque wrote: > > Are all the threads in the same Python process? No > Or the same machine? No > Do they have to persist across process (or machine) restarts? Yes. Playing around with using F() but still don't have it working as desired. > On Wed, 23

Re: getting unique id

2022-11-23 Thread Thomas Lockhart
Why not use the existing Django AutoField? - Tom > On Nov 23, 2022, at 8:56 AM, Larry Martell wrote: > > I have an app that needs to get a unique ID. Many threads run at the > same time that need one. I would like the IDs to be sequential. When I > need a unique ID I do this: > > with

Re: getting unique id

2022-11-23 Thread Shaheed Haque
Are all the threads in the same Python process? Or the same machine? Do they have to persist across process (or machine) restarts? On Wed, 23 Nov 2022, 16:57 Larry Martell, wrote: > I have an app that needs to get a unique ID. Many threads run at the > same time that need one. I would like the