79700911

Date: 2025-07-14 13:04:35
Score: 1.5
Natty:
Report link

The cleanest, most robust approach is to use a DB-side sequence (PostgreSQL’s CREATE SEQUENCE or the django-sequences package) so that each order_sl is allocated atomically by the database itself. If you cannot add a sequence, wrap your max-lookup and insert in a single transaction with select_for_update().

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: shaf shafiq