If you are interested in the backgrounds of this part, you can have a look at Medium, we posted an article there some time ago.
If you want to keep track of the creator, creation time, last modificator and last modification time,
you can use the abstract class
CommonInfo like this:
from ai_django_core.models import CommonInfo class MyFancyModel(CommonInfo): ...
You then get four fields:
If you are interested in the details, just have a look at the code base.
Automatic object ownership¶
If you want to keep track of object ownership automatically, you can use the
Just make sure, you’ll insert it after djangos
MIDDLEWARE = ( ... 'django.contrib.auth.middleware.AuthenticationMiddleware', 'ai_django_core.middleware.current_user.CurrentUserMiddleware', )
Using this middleware will automatically and thread-safe keep track of the ownership of all models,
which derive from