Return to Views.
Base class for all projector views.
Logic should be implemented at response method.
Would check necessary permissions defined by class attributes: perms, perms_GET and perms_POST.
perms are always checked, perms_POST are additional checks which would be made for GET method requests only and perms_POST would be made for POST method requests. perms_private would be checked for private projects only.
Note
This view class should be considered as abstract - it does not implement response method.
View attributes
Required parameters
Context variables
Checks if user has permissions to call this view. By default, this method would perform checks using requested Project instance and permission list retrieved by get_required_perms method.
Returns list of required perms based on instance’s attributes. If modified, make sure it’s thread-safe, i.e. don’t change self.perms directly but create new temporary list of permissions.
Bases: projector.views.project.ProjectView
Returns selected project’s detail for user given in request. We make necessary permission checks after dispatching between normal and mercurial request, as mercurial requests has it’s own permission requirements.
View attributes
Checks if user has permissions to call this view. By default, this method would perform checks using requested Project instance and permission list retrieved by get_required_perms method.
Returns empty list if request is identified as mercurial request. For mercurial requests lets underlying view to manage permissions checks.
Bases: projector.core.controllers.View
Project listing view.
View attributes
Additional context variables
Bases: projector.core.controllers.View
New project creation view.
See also
Additional context variables
Checks if given user can create project. Note that this function will not validate project itself. If PROJECTOR_MILIS_BETWEEN_PROJECT_CREATION is greater than miliseconds since last time this user has created a project then he or she is allowed to create new one.
If user is trying to create more project than specified by PROJECTOR_MAX_PROJECTS_PER_USER configuration value then we disallow.
If request is given, sends messages.
Bases: projector.views.project.ProjectView
Project fork (internal fork) view.
See also
Additional context variables
Checks if user has permissions to call this view. By default, this method would perform checks using requested Project instance and permission list retrieved by get_required_perms method.
Returns list of required perms based on instance’s attributes. If modified, make sure it’s thread-safe, i.e. don’t change self.perms directly but create new temporary list of permissions.