当前位置: 首页>>代码示例>>Python>>正文


Python forms.AdminPasswordChangeForm方法代码示例

本文整理汇总了Python中django.contrib.admin.forms.AdminPasswordChangeForm方法的典型用法代码示例。如果您正苦于以下问题:Python forms.AdminPasswordChangeForm方法的具体用法?Python forms.AdminPasswordChangeForm怎么用?Python forms.AdminPasswordChangeForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在django.contrib.admin.forms的用法示例。


在下文中一共展示了forms.AdminPasswordChangeForm方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: password_change

# 需要导入模块: from django.contrib.admin import forms [as 别名]
# 或者: from django.contrib.admin.forms import AdminPasswordChangeForm [as 别名]
def password_change(self, request, extra_context=None):
        """
        Handles the "change password" task -- both form display and validation.
        """
        from django.contrib.admin.forms import AdminPasswordChangeForm
        from django.contrib.auth.views import password_change
        url = reverse('admin:password_change_done', current_app=self.name)
        defaults = {
            'current_app': self.name,
            'password_change_form': AdminPasswordChangeForm,
            'post_change_redirect': url,
            'extra_context': dict(self.each_context(request), **(extra_context or {})),
        }
        if self.password_change_template is not None:
            defaults['template_name'] = self.password_change_template
        return password_change(request, **defaults) 
开发者ID:lanbing510,项目名称:GTDWeb,代码行数:18,代码来源:sites.py

示例2: password_change

# 需要导入模块: from django.contrib.admin import forms [as 别名]
# 或者: from django.contrib.admin.forms import AdminPasswordChangeForm [as 别名]
def password_change(self, request, extra_context=None):
        """
        Handle the "change password" task -- both form display and validation.
        """
        from django.contrib.admin.forms import AdminPasswordChangeForm
        from django.contrib.auth.views import PasswordChangeView
        url = reverse('admin:password_change_done', current_app=self.name)
        defaults = {
            'form_class': AdminPasswordChangeForm,
            'success_url': url,
            'extra_context': dict(self.each_context(request), **(extra_context or {})),
        }
        if self.password_change_template is not None:
            defaults['template_name'] = self.password_change_template
        request.current_app = self.name
        return PasswordChangeView.as_view(**defaults)(request) 
开发者ID:reBiocoder,项目名称:bioforum,代码行数:18,代码来源:sites.py

示例3: password_change

# 需要导入模块: from django.contrib.admin import forms [as 别名]
# 或者: from django.contrib.admin.forms import AdminPasswordChangeForm [as 别名]
def password_change(self, request, extra_context=None):
        """
        Handle the "change password" task -- both form display and validation.
        """
        from django.contrib.admin.forms import AdminPasswordChangeForm
        from django.contrib.auth.views import PasswordChangeView
        url = reverse('admin:password_change_done', current_app=self.name)
        defaults = {
            'form_class': AdminPasswordChangeForm,
            'success_url': url,
            'extra_context': {**self.each_context(request), **(extra_context or {})},
        }
        if self.password_change_template is not None:
            defaults['template_name'] = self.password_change_template
        request.current_app = self.name
        return PasswordChangeView.as_view(**defaults)(request) 
开发者ID:PacktPublishing,项目名称:Hands-On-Application-Development-with-PyCharm,代码行数:18,代码来源:sites.py

示例4: password_change

# 需要导入模块: from django.contrib.admin import forms [as 别名]
# 或者: from django.contrib.admin.forms import AdminPasswordChangeForm [as 别名]
def password_change(self, request, extra_context=None):
        """
        Handles the "change password" task -- both form display and validation.
        """
        from django.contrib.admin.forms import AdminPasswordChangeForm
        from django.contrib.auth.views import PasswordChangeView
        url = reverse('admin:password_change_done', current_app=self.name)
        defaults = {
            'form_class': AdminPasswordChangeForm,
            'success_url': url,
            'extra_context': dict(self.each_context(request), **(extra_context or {})),
        }
        if self.password_change_template is not None:
            defaults['template_name'] = self.password_change_template
        request.current_app = self.name
        return PasswordChangeView.as_view(**defaults)(request) 
开发者ID:Yeah-Kun,项目名称:python,代码行数:18,代码来源:sites.py

示例5: password_change

# 需要导入模块: from django.contrib.admin import forms [as 别名]
# 或者: from django.contrib.admin.forms import AdminPasswordChangeForm [as 别名]
def password_change(self, request, extra_context=None):
        """
        Handles the "change password" task -- both form display and validation.
        """
        from django.contrib.admin.forms import AdminPasswordChangeForm
        from django.contrib.auth.views import password_change
        url = reverse('admin:password_change_done', current_app=self.name)
        defaults = {
            'password_change_form': AdminPasswordChangeForm,
            'post_change_redirect': url,
            'extra_context': dict(self.each_context(request), **(extra_context or {})),
        }
        if self.password_change_template is not None:
            defaults['template_name'] = self.password_change_template
        request.current_app = self.name
        return password_change(request, **defaults) 
开发者ID:drexly,项目名称:openhgsenti,代码行数:18,代码来源:sites.py


注:本文中的django.contrib.admin.forms.AdminPasswordChangeForm方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。