constants.py 696 B

12345678910111213141516171819202122
  1. import string
  2. from django.db.models import Q
  3. OBJECTPERMISSION_OBJECT_TYPES = (
  4. (Q(public=True) & ~Q(app_label='core', model='objecttype'))
  5. | Q(app_label='core', model__in=['managedfile'])
  6. | Q(app_label='extras', model__in=['scriptmodule', 'taggeditem'])
  7. )
  8. CONSTRAINT_TOKEN_USER = '$user'
  9. # Django's four default model permissions. These receive special handling
  10. # (dedicated checkboxes, model properties) and should not be registered
  11. # as custom model actions.
  12. RESERVED_ACTIONS = ('view', 'add', 'change', 'delete')
  13. # API tokens
  14. TOKEN_PREFIX = 'nbt_' # Used for v2 tokens only
  15. TOKEN_KEY_LENGTH = 12
  16. TOKEN_DEFAULT_LENGTH = 40
  17. TOKEN_CHARSET = string.ascii_letters + string.digits