Re: How to aggregate on insert?

2016-05-24 Thread Erik Cederstrand
> Den 24. maj 2016 kl. 01.11 skrev James Schneider : > On Mon, May 23, 2016 at 12:58 PM, Erik Cederstrand > wrote: > > I have inherited a legacy Item model that has a composite unique key > consisting of a Customer ID and a per-customer,

Re: How to aggregate on insert?

2016-05-23 Thread James Schneider
On Mon, May 23, 2016 at 12:58 PM, Erik Cederstrand < erik+li...@cederstrand.dk> wrote: > Hi, > > I have inherited a legacy Item model that has a composite unique key > consisting of a Customer ID and a per-customer, incrementing Item ID. > Assume I can't change the model. > > On inserts, the

Re: How to aggregate on insert?

2016-05-23 Thread Erik Cederstrand
> Den 23. maj 2016 kl. 22.49 skrev Ketan Bhatt : > > Hey Erik, > > What Django version are you on? I'm on Django 1.9. Erik -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Re: How to aggregate on insert?

2016-05-23 Thread Ketan Bhatt
Hey Erik, What Django version are you on? On Tuesday, May 24, 2016 at 1:28:57 AM UTC+5:30, Erik Cederstrand wrote: > > Hi, > > I have inherited a legacy Item model that has a composite unique key > consisting of a Customer ID and a per-customer, incrementing Item ID. > Assume I can't change

How to aggregate on insert?

2016-05-23 Thread Erik Cederstrand
Hi, I have inherited a legacy Item model that has a composite unique key consisting of a Customer ID and a per-customer, incrementing Item ID. Assume I can't change the model. On inserts, the legacy code would let the database increment the Item ID to avoid race conditions. Something like