Does Django have an auto-increment field per user?

I was wondering if there is a way to create a separate autoincrement-ID-per-user field in Django?

Basically, I store many related models, and I need identifiers created to automatically create for each user.

I don’t want to change how it works id, I just need a new field that I can add, which is unique = True for the user.

Any suggestions (other than overriding persistence and its implementation)?

+3
source share
1 answer

, , , , . , , .

, , , count() . , - , meta unique_together.

?

:, URL, , :

myuser.myobject_set.all()[7]
+1

Source: https://habr.com/ru/post/1715316/


All Articles