app/soc/views/models/organization.py
author Lennard de Rijk <ljvderijk@gmail.com>
Tue, 24 Feb 2009 19:43:51 +0000
changeset 1484 6b00a2a43eaf
parent 1463 d25793debbfb
child 1489 e12e08c8b258
permissions -rw-r--r--
Changed the method and variable name in student_proposal to match the access type. Patch by: Lennard de Rijk Reviewed by: to-be-reviewed
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
682
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     1
#!/usr/bin/python2.5
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     2
#
1308
35b75ffcbb37 Partially reverted "Update the copyright notice for 2009."
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1307
diff changeset
     3
# Copyright 2008 the Melange authors.
682
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     4
#
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     5
# Licensed under the Apache License, Version 2.0 (the "License");
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     6
# you may not use this file except in compliance with the License.
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     7
# You may obtain a copy of the License at
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     8
#
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     9
#   http://www.apache.org/licenses/LICENSE-2.0
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    10
#
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    11
# Unless required by applicable law or agreed to in writing, software
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    12
# distributed under the License is distributed on an "AS IS" BASIS,
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    13
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    14
# See the License for the specific language governing permissions and
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    15
# limitations under the License.
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    16
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    17
"""Views for Organizations.
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    18
"""
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    19
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    20
__authors__ = [
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    21
    '"Sverre Rabbelier" <sverre@rabbelier.nl>',
1126
4fc86db70a76 Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1079
diff changeset
    22
    '"Lennard de Rijk" <ljvderijk@gmail.com>',
682
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    23
  ]
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    24
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    25
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    26
from django import forms
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    27
690
14e9f484412c Fix imports sorting in soc.views.models.organization.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 682
diff changeset
    28
from soc.logic import cleaning
682
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    29
from soc.logic import dicts
1344
d94410538f8e Redirect to the admin view in listPublic
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1343
diff changeset
    30
from soc.logic import accounts
1266
e8feadcbc47f Changed the access checks for organization.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1264
diff changeset
    31
from soc.logic.models import organization as org_logic
e8feadcbc47f Changed the access checks for organization.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1264
diff changeset
    32
from soc.logic.models import org_admin as org_admin_logic
1154
77276e2c46f7 Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1126
diff changeset
    33
from soc.logic.models import org_app as org_app_logic
1126
4fc86db70a76 Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1079
diff changeset
    34
from soc.views.helper import access
1325
8368086dd3a7 Add a list_public view to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1317
diff changeset
    35
from soc.views.helper import decorators
1154
77276e2c46f7 Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1126
diff changeset
    36
from soc.views.helper import dynaform
1325
8368086dd3a7 Add a list_public view to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1317
diff changeset
    37
from soc.views.helper import lists
682
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    38
from soc.views.helper import redirects
1154
77276e2c46f7 Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1126
diff changeset
    39
from soc.views.helper import widgets
682
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    40
from soc.views.models import group
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    41
from soc.views.models import program as program_view
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    42
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    43
import soc.models.organization
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    44
import soc.logic.models.organization
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    45
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    46
class View(group.View):
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    47
  """View methods for the Organization model.
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    48
  """
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    49
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    50
  def __init__(self, params=None):
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    51
    """Defines the fields and methods required for the base View class
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    52
    to provide the user with list, public, create, edit and delete views.
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    53
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    54
    Params:
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    55
      original_params: a dict with params for this View
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    56
    """
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    57
1436
b356b2d7653c Fix access bug in organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1430
diff changeset
    58
    all = "%(scope_path)s/%(link_id)s"
b356b2d7653c Fix access bug in organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1430
diff changeset
    59
1126
4fc86db70a76 Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1079
diff changeset
    60
    rights = access.Checker(params)
1325
8368086dd3a7 Add a list_public view to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1317
diff changeset
    61
    rights['any_access'] = ['allow']
8368086dd3a7 Add a list_public view to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1317
diff changeset
    62
    rights['show'] = ['allow']
1126
4fc86db70a76 Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1079
diff changeset
    63
    rights['create'] = ['checkIsDeveloper']
1436
b356b2d7653c Fix access bug in organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1430
diff changeset
    64
    rights['edit'] = [('checkHasActiveRoleForScope',
b356b2d7653c Fix access bug in organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1430
diff changeset
    65
                           [org_admin_logic.logic, all]),
1266
e8feadcbc47f Changed the access checks for organization.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1264
diff changeset
    66
                      ('checkIsActive', [org_logic.logic, None])]
1126
4fc86db70a76 Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1079
diff changeset
    67
    rights['delete'] = ['checkIsDeveloper']
4fc86db70a76 Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1079
diff changeset
    68
    rights['home'] = ['allow']
1325
8368086dd3a7 Add a list_public view to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1317
diff changeset
    69
    rights['public_list'] = ['allow']
1405
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
    70
    rights['apply_mentor'] = ['checkIsUser']
1266
e8feadcbc47f Changed the access checks for organization.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1264
diff changeset
    71
    rights['list_requests'] = [('checkHasActiveRoleForScope', 
1436
b356b2d7653c Fix access bug in organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1430
diff changeset
    72
                                [org_admin_logic.logic, all])]
1266
e8feadcbc47f Changed the access checks for organization.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1264
diff changeset
    73
    rights['list_roles'] = [('checkHasActiveRoleForScope', 
1436
b356b2d7653c Fix access bug in organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1430
diff changeset
    74
                             [org_admin_logic.logic, all])]
1266
e8feadcbc47f Changed the access checks for organization.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1264
diff changeset
    75
    rights['applicant'] = [('checkIsApplicationAccepted',
e8feadcbc47f Changed the access checks for organization.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1264
diff changeset
    76
                            org_app_logic.logic)]
1126
4fc86db70a76 Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1079
diff changeset
    77
682
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    78
    new_params = {}
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    79
    new_params['logic'] = soc.logic.models.organization.logic
1325
8368086dd3a7 Add a list_public view to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1317
diff changeset
    80
    new_params['rights'] = rights
682
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    81
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    82
    new_params['scope_view'] = program_view
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    83
    new_params['scope_redirect'] = redirects.getCreateRedirect
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    84
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    85
    new_params['name'] = "Organization"
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    86
    new_params['url_name'] = "org"
1303
08433090cff8 Add prefix filtering and refactored program field generation
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1284
diff changeset
    87
    new_params['document_prefix'] = "org"
1126
4fc86db70a76 Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1079
diff changeset
    88
    new_params['sidebar_grouping'] = 'Organizations'
682
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    89
1126
4fc86db70a76 Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1079
diff changeset
    90
    new_params['public_template'] = 'soc/organization/public.html'
4fc86db70a76 Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1079
diff changeset
    91
    new_params['list_row'] = 'soc/organization/list/row.html'
4fc86db70a76 Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1079
diff changeset
    92
    new_params['list_heading'] = 'soc/organization/list/heading.html'
4fc86db70a76 Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1079
diff changeset
    93
1154
77276e2c46f7 Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1126
diff changeset
    94
    new_params['application_logic'] = org_app_logic
77276e2c46f7 Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1126
diff changeset
    95
    new_params['group_applicant_url'] = True
1325
8368086dd3a7 Add a list_public view to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1317
diff changeset
    96
    new_params['sans_link_id_public_list'] = True
1154
77276e2c46f7 Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1126
diff changeset
    97
1405
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
    98
    patterns = []
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
    99
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
   100
    patterns += [(r'^%(url_name)s/(?P<access_type>apply_mentor)/%(scope)s$',
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
   101
        'soc.views.models.%(module_name)s.apply_mentor', 
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
   102
        "List of all %(name_plural)s you can apply to"),]
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
   103
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
   104
    new_params['extra_django_patterns'] = patterns
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
   105
1430
ff8cc6b15e6a Rename dynafields to dynaproperties
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1406
diff changeset
   106
    new_params['create_extra_dynaproperties'] = {
682
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
   107
        'scope_path': forms.CharField(widget=forms.HiddenInput,
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
   108
                                   required=True),
1391
09a95e57caa7 Added a missing cleaner to org idea list
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1344
diff changeset
   109
        'clean_ideas': cleaning.clean_url('ideas'),
1221
0130e63704ac Remove extra whitespaces in soc.views.models.organization module.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 1205
diff changeset
   110
        'clean': cleaning.validate_new_group('link_id', 'scope_path',
1325
8368086dd3a7 Add a list_public view to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1317
diff changeset
   111
            soc.logic.models.organization, org_app_logic)
8368086dd3a7 Add a list_public view to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1317
diff changeset
   112
        }
1205
2e88261aba72 Added validate_new_group to cleaning and removed clean_new_club_link_id.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1154
diff changeset
   113
2e88261aba72 Added validate_new_group to cleaning and removed clean_new_club_link_id.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1154
diff changeset
   114
    # get rid of the clean method
1430
ff8cc6b15e6a Rename dynafields to dynaproperties
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1406
diff changeset
   115
    new_params['edit_extra_dynaproperties'] = {
1221
0130e63704ac Remove extra whitespaces in soc.views.models.organization module.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 1205
diff changeset
   116
        'clean': (lambda x: x.cleaned_data)}
682
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
   117
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
   118
    params = dicts.merge(params, new_params)
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
   119
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
   120
    super(View, self).__init__(params=params)
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
   121
1154
77276e2c46f7 Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1126
diff changeset
   122
    # create and store the special form for applicants
77276e2c46f7 Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1126
diff changeset
   123
    updated_fields = {
77276e2c46f7 Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1126
diff changeset
   124
        'link_id': forms.CharField(widget=widgets.ReadOnlyInput(),
77276e2c46f7 Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1126
diff changeset
   125
            required=False),
1325
8368086dd3a7 Add a list_public view to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1317
diff changeset
   126
        'clean_link_id': cleaning.clean_link_id('link_id')
8368086dd3a7 Add a list_public view to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1317
diff changeset
   127
        }
1154
77276e2c46f7 Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1126
diff changeset
   128
77276e2c46f7 Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1126
diff changeset
   129
    applicant_create_form = dynaform.extendDynaForm(
77276e2c46f7 Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1126
diff changeset
   130
        dynaform = self._params['create_form'],
1430
ff8cc6b15e6a Rename dynafields to dynaproperties
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1406
diff changeset
   131
        dynaproperties = updated_fields)
1154
77276e2c46f7 Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1126
diff changeset
   132
77276e2c46f7 Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1126
diff changeset
   133
    params['applicant_create_form'] = applicant_create_form
77276e2c46f7 Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1126
diff changeset
   134
1325
8368086dd3a7 Add a list_public view to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1317
diff changeset
   135
  @decorators.merge_params
8368086dd3a7 Add a list_public view to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1317
diff changeset
   136
  @decorators.check_access
1405
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
   137
  def applyMentor(self, request, access_type,
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
   138
                  page_name=None, params=None, **kwargs):
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
   139
    """Shows a list of all organizations and you can choose one to 
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
   140
       apply to become a mentor.
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
   141
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
   142
    Args:
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
   143
      request: the standard Django HTTP request object
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
   144
      access_type : the name of the access type which should be checked
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
   145
      page_name: the page name displayed in templates as page and header title
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
   146
      params: a dict with params for this View
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
   147
      kwargs: the Key Fields for the specified entity
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
   148
    """
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
   149
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
   150
    list_params = params.copy()
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
   151
    list_params['list_action'] = (redirects.getRequestRedirectForRole, 'mentor')
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
   152
    list_params['list_description'] = ('Choose an Organization which '
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
   153
        'you want to become a Mentor for.')
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
   154
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
   155
    filter = {'scope_path': kwargs['scope_path'],
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
   156
              'status' : 'active'}
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
   157
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
   158
    return self.list(request, access_type, 
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
   159
        page_name, params=list_params, filter=filter)
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
   160
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
   161
  @decorators.merge_params
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
   162
  @decorators.check_access
1325
8368086dd3a7 Add a list_public view to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1317
diff changeset
   163
  def listPublic(self, request, access_type, page_name=None,
8368086dd3a7 Add a list_public view to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1317
diff changeset
   164
           params=None, filter=None, **kwargs):
8368086dd3a7 Add a list_public view to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1317
diff changeset
   165
    """See base.View.list.
8368086dd3a7 Add a list_public view to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1317
diff changeset
   166
    """
8368086dd3a7 Add a list_public view to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1317
diff changeset
   167
8368086dd3a7 Add a list_public view to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1317
diff changeset
   168
    new_params = {}
1344
d94410538f8e Redirect to the admin view in listPublic
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1343
diff changeset
   169
    if accounts.isDeveloper():
d94410538f8e Redirect to the admin view in listPublic
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1343
diff changeset
   170
      new_params['list_action'] = (redirects.getAdminRedirect, params)
d94410538f8e Redirect to the admin view in listPublic
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1343
diff changeset
   171
    else:
d94410538f8e Redirect to the admin view in listPublic
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1343
diff changeset
   172
      new_params['list_action'] = (redirects.getPublicRedirect, params)
1325
8368086dd3a7 Add a list_public view to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1317
diff changeset
   173
    # safe to merge them the wrong way around because of @merge_params
8368086dd3a7 Add a list_public view to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1317
diff changeset
   174
    params = dicts.merge(new_params, params)
8368086dd3a7 Add a list_public view to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1317
diff changeset
   175
8368086dd3a7 Add a list_public view to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1317
diff changeset
   176
    new_filter = {}
1406
60b68fc36df2 List public view for organizations should be program limited.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1405
diff changeset
   177
60b68fc36df2 List public view for organizations should be program limited.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1405
diff changeset
   178
    new_filter['scope_path'] = kwargs['scope_path']
1325
8368086dd3a7 Add a list_public view to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1317
diff changeset
   179
    new_filter['status'] = 'active'
8368086dd3a7 Add a list_public view to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1317
diff changeset
   180
    filter = dicts.merge(filter, new_filter)
8368086dd3a7 Add a list_public view to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1317
diff changeset
   181
8368086dd3a7 Add a list_public view to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1317
diff changeset
   182
    content = lists.getListContent(request, params, filter)
8368086dd3a7 Add a list_public view to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1317
diff changeset
   183
    contents = [content]
8368086dd3a7 Add a list_public view to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1317
diff changeset
   184
8368086dd3a7 Add a list_public view to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1317
diff changeset
   185
    return self._list(request, params, contents, page_name)
1154
77276e2c46f7 Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1126
diff changeset
   186
1264
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   187
  def _getExtraMenuItems(self, role_description, params=None):
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   188
    """Used to create the specific Organization menu entries.
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   189
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   190
    For args see group.View._getExtraMenuItems().
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   191
    """
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   192
    submenus = []
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   193
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   194
    group_entity = role_description['group']
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   195
    roles = role_description['roles']
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   196
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   197
    if roles.get('org_admin'):
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   198
      # add a link to the management page
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   199
      submenu = (redirects.getListRolesRedirect(group_entity, params),
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   200
          "Manage Admins and Mentors", 'any_access')
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   201
      submenus.append(submenu)
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   202
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   203
      # add a link to invite an org admin
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   204
      submenu = (redirects.getInviteRedirectForRole(group_entity, 'org_admin'),
1463
d25793debbfb Remove superfluous 'Org' in links
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1436
diff changeset
   205
          "Invite an Admin", 'any_access')
1264
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   206
      submenus.append(submenu)
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   207
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   208
      # add a link to invite a member
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   209
      submenu = (redirects.getInviteRedirectForRole(group_entity, 'mentor'),
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   210
          "Invite a Mentor", 'any_access')
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   211
      submenus.append(submenu)
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   212
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   213
      # add a link to the request page
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   214
      submenu = (redirects.getListRequestsRedirect(group_entity, params), 
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   215
          "List Requests and Invites", 'any_access')
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   216
      submenus.append(submenu)
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   217
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   218
      # add a link to the edit page
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   219
      submenu = (redirects.getEditRedirect(group_entity, params), 
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   220
          "Edit Organization Profile", 'any_access')
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   221
      submenus.append(submenu)
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   222
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   223
    if roles.get('org_admin') or roles.get('mentor'):
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   224
      submenu = (redirects.getCreateDocumentRedirect(group_entity, 'org'),
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   225
          "Create a New Document", 'any_access')
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   226
      submenus.append(submenu)
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   227
1317
fad74cf4e5da Add a 'list documents' link everywhere
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1308
diff changeset
   228
      submenu = (redirects.getListDocumentsRedirect(group_entity, 'org'),
fad74cf4e5da Add a 'list documents' link everywhere
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1308
diff changeset
   229
          "List Documents", 'any_access')
fad74cf4e5da Add a 'list documents' link everywhere
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1308
diff changeset
   230
      submenus.append(submenu)
fad74cf4e5da Add a 'list documents' link everywhere
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1308
diff changeset
   231
1264
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   232
    if roles.get('org_admin'):
1283
438dceed3132 Add ToS agreement to org_admin application related forms.
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1266
diff changeset
   233
      # add a link to the resign page
1264
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   234
      submenu = (redirects.getManageRedirect(roles['org_admin'], 
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   235
          {'url_name': 'org_admin'}), 
1463
d25793debbfb Remove superfluous 'Org' in links
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1436
diff changeset
   236
          "Resign as Admin", 'any_access')
1264
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   237
      submenus.append(submenu)
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   238
1283
438dceed3132 Add ToS agreement to org_admin application related forms.
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1266
diff changeset
   239
      # add a link to the edit page
438dceed3132 Add ToS agreement to org_admin application related forms.
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1266
diff changeset
   240
      submenu = (redirects.getEditRedirect(roles['org_admin'],
438dceed3132 Add ToS agreement to org_admin application related forms.
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1266
diff changeset
   241
          {'url_name': 'org_admin'}),
1463
d25793debbfb Remove superfluous 'Org' in links
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1436
diff changeset
   242
          "Edit My Admin Profile", 'any_access')
1283
438dceed3132 Add ToS agreement to org_admin application related forms.
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1266
diff changeset
   243
      submenus.append(submenu)
438dceed3132 Add ToS agreement to org_admin application related forms.
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1266
diff changeset
   244
1264
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   245
    if roles.get('mentor'):
1284
92f7a24d8f42 Add ToS agreement to mentor application related forms.
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1283
diff changeset
   246
      # add a link to the resign page
1264
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   247
      submenu = (redirects.getManageRedirect(roles['mentor'], 
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   248
          {'url_name' : 'mentor'}), 
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   249
          "Resign as Mentor", 'any_access')
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   250
      submenus.append(submenu)
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   251
1284
92f7a24d8f42 Add ToS agreement to mentor application related forms.
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1283
diff changeset
   252
      # add a link to the edit page
92f7a24d8f42 Add ToS agreement to mentor application related forms.
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1283
diff changeset
   253
      submenu = (redirects.getEditRedirect(roles['mentor'],
92f7a24d8f42 Add ToS agreement to mentor application related forms.
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1283
diff changeset
   254
          {'url_name': 'mentor'}),
1463
d25793debbfb Remove superfluous 'Org' in links
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1436
diff changeset
   255
          "Edit My Mentor Profile", 'any_access')
1284
92f7a24d8f42 Add ToS agreement to mentor application related forms.
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1283
diff changeset
   256
      submenus.append(submenu)
92f7a24d8f42 Add ToS agreement to mentor application related forms.
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1283
diff changeset
   257
1264
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1221
diff changeset
   258
    return submenus
1126
4fc86db70a76 Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1079
diff changeset
   259
682
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
   260
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
   261
view = View()
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
   262
1343
4ba39392c854 Hook up the admin view everywhere
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1325
diff changeset
   263
admin = view.admin
1154
77276e2c46f7 Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1126
diff changeset
   264
applicant = view.applicant
1405
43b482f48b12 Added apply as a mentor view which lists all orgs for a given program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1391
diff changeset
   265
apply_mentor = view.applyMentor
682
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
   266
create = view.create
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
   267
delete = view.delete
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
   268
edit = view.edit
1126
4fc86db70a76 Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1079
diff changeset
   269
home = view.home
682
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
   270
list = view.list
1325
8368086dd3a7 Add a list_public view to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1317
diff changeset
   271
list_public = view.listPublic
1126
4fc86db70a76 Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1079
diff changeset
   272
list_requests = view.listRequests
4fc86db70a76 Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1079
diff changeset
   273
list_roles = view.listRoles
682
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
   274
public = view.public
858
e79e7a22326f Add an export() view, and implement it as text/text for Document.
Todd Larsen <tlarsen@google.com>
parents: 799
diff changeset
   275
export = view.export
934
9fcc08971efe Add a 'pick' view to the appropriate views
Sverre Rabbelier <srabbelier@gmail.com>
parents: 858
diff changeset
   276
pick = view.pick