예제 #1
0
파일: forms.py 프로젝트: a2call/tendenci
 def __init__(self, user, editor, request, *args, **kwargs):
     self.user = user
     self.editor = editor
     self.request = request
     super(UserGroupsForm, self).__init__(*args, **kwargs)
     self.old_groups = get_groups(self.user, filter=Group.objects.search(user=editor))
     self.old_memberships = get_memberships(self.user, filter=Group.objects.search(user=editor))
     self.fields['groups'].initial = self.old_groups
     self.fields['groups'].choices = group_choices(editor)
예제 #2
0
 def __init__(self, user, editor, request, *args, **kwargs):
     self.user = user
     self.editor = editor
     self.request = request
     super(UserGroupsForm, self).__init__(*args, **kwargs)
     self.old_groups = get_groups(self.user, filter=Group.objects.search(user=editor))
     self.old_memberships = get_memberships(self.user, filter=Group.objects.search(user=editor))
     self.fields['groups'].initial = self.old_groups
     self.fields['groups'].choices = group_choices(editor)