Пример #1
0
    def __init__(self, mode, user=None, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self._mode = mode
        self._user = user
        if user:
            self.user_id = user.id
            self.name.data = self._user.name
            self.username.data = self._user.username
            self.role.data = self._user.role.id

        self.role.choices = Role.choices()
Пример #2
0
	def __init__(self, original_username, original_email, *args, **kwargs):
		super(EditUserProfileForm, self).__init__(*args, **kwargs)
		self.original_username = original_username
		self.original_email = original_email
		self.language.choices = Language.choices()
		self.role.choices = Role.choices()
Пример #3
0
	def __init__(self, *args, **kwargs):
		super(UserForm, self).__init__(*args, **kwargs)
		self.language.choices = Language.choices()
		self.role.choices = Role.choices()