> First, I wouldn't be concerned about collisions in uuid generation > unless I was working on space probe software. > > Second, the code would loop nearly never, meaning O(1) on average. > Worst case is worse, but again, unless you're saving lives, it's fine.
Exactly! But not just O(1). I should be able to do it with just one hit at the database. Second (and subsequent) hit(s) should occur only in the case of an insert exception (AssertionFailed). But the way Django doesn't differentiate b/w INSERTs and UPDATEs, I have to manually check for collisions and hit the database TWO TIMES for every new entry (that's silly). Django always "saves". If I don't check manually, collisions won't result in 500. Worse, Django will *overwrite* any previously existing data. And that's what concerns me! For UUIDs, there are almost no chances of collisions. But consider that someone wants primary key to be employee ID, registration no. etc. What then? arvind1 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---
