Django Admin
Account admin.
- class smarter.apps.secret.admin.CustomPasswordWidget(attrs=None)[source]
Bases:
WidgetCustom widget for the password field in the UserChangeForm.
- property media
- class smarter.apps.secret.admin.SecretAdmin(model, admin_site)[source]
Bases:
SmarterCustomerModelAdmin,SmarterHelperMixinSecret model admin. This is a primary Smarter resource, that descends directly from MetaDataWithOwnershipModel. Visibility of Secrets is determined by ownership and role.
- display_value(obj)[source]
Display the secret value as ‘****’ for users who do not have permission to view it.
- fields = ('name', 'user_profile', 'description', 'expires_at', 'display_value')
- form
alias of
SecretAdminForm
- get_form(request, obj=None, change=False, **kwargs)[source]
Return a Form class for use in the admin add view. This is used by add_view and change_view.
- get_queryset(request)[source]
Return a QuerySet of all model instances that can be edited by the admin site. This is used by changelist_view.
- list_display = ('user_profile', 'name', 'description', 'created_at', 'updated_at', 'last_accessed', 'expires_at')
- logger_prefix = '\x1b[1;31msmarter.apps.secret.admin.SecretAdmin()\x1b[0m'
- property media
- readonly_fields = ('created_at', 'updated_at', 'last_accessed', 'display_value')
- request: HttpRequest
- user_profile: UserProfile
- class smarter.apps.secret.admin.SecretAdminForm(*args, **kwargs)[source]
Bases:
ModelFormCustom form for SecretAdmin to handle the transient ‘value’ field.
Form fields:
value: Value (CharField)
- list_display = ['name', 'user_profile', 'description', 'expires_at', 'value']
- logger_prefix = '\x1b[1;31msmarter.apps.secret.admin.SecretAdminForm()\x1b[0m'
- property media
Return all media required to render the widgets on this form.