I'm working on a django SaaS app, which hosts data for multiple organisations. Each record in a table has a unique RecordNumber.
I could use autofield to give each record a unique incrementing Id automatically, but that is globally unique. As in org1 might have say, RecordNum=1 or 2 or 7 etc and org2 might have RecordNum=3,4,5,6 I want each organisation to have its own sequence, i.e. all organisations might have RecordNum=1 or 2...etc. I can still use autofield as primary key to identify the row. But i need the RecordNum field as it will be visible to the end users as sequence numbers within their org. UUID, are too cumbersome to type in while searching for a record. I found this - http://stackoverflow.com/questions/1104741/generating-sequential-numbers-in-multi-user-saas-application But i before resorting to stored procedures, i want to make sure there isn't any other way. Ohh and btw i'm on MySQL. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---