You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jumpserver/apps/perms/forms.py

36 lines
1.1 KiB

8 years ago
# ~*~ coding: utf-8 ~*~
from __future__ import absolute_import, unicode_literals
from django import forms
from django.utils.translation import ugettext_lazy as _
from .models import AssetPermission
8 years ago
class AssetPermissionForm(forms.ModelForm):
8 years ago
class Meta:
model = AssetPermission
exclude = (
'id', 'date_created', 'created_by'
)
8 years ago
widgets = {
'users': forms.SelectMultiple(
attrs={'class': 'select2', 'data-placeholder': _("User")}
7 years ago
),
'user_groups': forms.SelectMultiple(
7 years ago
attrs={'class': 'select2', 'data-placeholder': _("User group")}
),
'assets': forms.SelectMultiple(
attrs={'class': 'select2', 'data-placeholder': _("Asset")}
),
'nodes': forms.SelectMultiple(
attrs={'class': 'select2', 'data-placeholder': _("Node")}
),
'system_users': forms.SelectMultiple(
7 years ago
attrs={'class': 'select2', 'data-placeholder': _('System user')}
),
}
labels = {
'nodes': _("Node"),
}