pluserable.web.pyramid.views module

Views for Pyramid applications.

class pluserable.web.pyramid.views.AuthView(request)[source]

Bases: pluserable.web.pyramid.views.BaseView

View that does login and logout.

login(handle=None)[source]

Present the login form, or validate data and authenticate user.

Return type

Dict[str, Any]

login_ajax()[source]
Return type

Dict[str, Any]

logout(url=None)[source]

Remove the auth cookies and redirect…

…to the view defined in the logout_redirect setting, which defaults to a view named ‘index’.

Return type

HTTPFound

class pluserable.web.pyramid.views.BaseView(request)[source]

Bases: object

Base class for pluserable views.

property request: pluserable.web.pyramid.typing.PRequest

Return the current request.

Return type

PRequest

strings

Keep the strings class memoized.

class pluserable.web.pyramid.views.ForgotPasswordView(request)[source]

Bases: pluserable.web.pyramid.views.BaseView

forgot_password()[source]

Show or process the “forgot password” form.

Create a token and send email for user to click link.

Return type

HTTPFound

reset_password()[source]

Show or process the “reset password” form.

After user clicked link on email message.

Return type

Dict[str, Any]

class pluserable.web.pyramid.views.ProfileView(request)[source]

Bases: pluserable.web.pyramid.views.BaseView

edit_profile()[source]

Let the user change her own email or password.

Return type

Dict[str, Any]

profile()[source]

Display a user profile.

Return type

Dict[str, Any]

class pluserable.web.pyramid.views.RegisterView(request)[source]

Bases: pluserable.web.pyramid.views.BaseView

activate()[source]
Return type

HTTPFound

persist_user(controls)[source]

To change how the user is stored, override this method.

Return type

TUser

register()[source]

Register a virtual subclass of an ABC.

Returns the subclass, to allow usage as a class decorator.

Return type

Dict[str, Any]

pluserable.web.pyramid.views.authenticated(request, userid)[source]

Set the auth cookies and redirect.

…either to the URL indicated in the “next” request parameter, or to the page defined in kerno.pluserable_settings[“login_redirect”], which defaults to a view named ‘index’.

Return type

HTTPFound

pluserable.web.pyramid.views.get_config_route(request, config_key)[source]

Resolve config_key to a URL, usually for redirection.

Return type

str

pluserable.web.pyramid.views.get_default_pluserable_settings()[source]

Return default pluserable settings.

In order to customize Pluserable to its purpose, user code calls this and manipulates the returned dictionary. Here we return defaults that user code can change.

Return type

Dict[str, Any]

pluserable.web.pyramid.views.get_pyramid_views_config()[source]

Return a dictionary for registering Pyramid views.

pluserable.web.pyramid.views.includeme(config)[source]

Set up pluserable routes and views in Pyramid.

Return type

None

pluserable.web.pyramid.views.render_form(request, form, appstruct=None, **kw)[source]

Return the deform form rendered with appstruct data.

Return type

Dict[str, Any]

pluserable.web.pyramid.views.validate_form(controls, form)[source]
Return type

Dict[str, Any]