app/soc/views/models/user.py
author Lennard de Rijk <ljvderijk@gmail.com>
Tue, 03 Feb 2009 13:50:41 +0000
changeset 1201 0a4c1af700a0
parent 1190 449b9d93d890
child 1307 091a21cf3627
permissions -rw-r--r--
Added checkCanReviewGroupApp to acces.py. To make this work allowSidebar decorator was added as well. This will make sure that the Review buttons show up in the sidebar. Patch by: Lennard de Rijk Reviewed by: to-be-reviewed
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
460
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     1
#!/usr/bin/python2.5
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     2
#
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     3
# Copyright 2008 the Melange authors.
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     4
#
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     5
# Licensed under the Apache License, Version 2.0 (the "License");
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     6
# you may not use this file except in compliance with the License.
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     7
# You may obtain a copy of the License at
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     8
#
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     9
#   http://www.apache.org/licenses/LICENSE-2.0
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    10
#
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    11
# Unless required by applicable law or agreed to in writing, software
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    12
# distributed under the License is distributed on an "AS IS" BASIS,
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    13
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    14
# See the License for the specific language governing permissions and
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    15
# limitations under the License.
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    16
590
37735d97b541 Created a seperate module for editSelf things
Sverre Rabbelier <srabbelier@gmail.com>
parents: 587
diff changeset
    17
"""Views for User profiles.
460
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    18
"""
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    19
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    20
__authors__ = [
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    21
    '"Sverre Rabbelier" <sverre@rabbelier.nl>',
1042
edd125206703 Renamed _getToSExampleText to getToSExampleText in soc/views/models/user.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1030
diff changeset
    22
    '"Lennard de Rijk" <ljvderijk@gmail.com>',
470
7ba510d3fad3 In soc.views.models.user module fix too long line. Delete unused email variable, add missing doc and rename self method and global variable to editSelf and edit_self so it's not confused with "self" used in classes and there is no outerscope variable name overwriting anymore.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 460
diff changeset
    23
    '"Pawel Solyga" <pawel.solyga@gmail.com>',
460
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    24
  ]
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    25
499
d22e4fe8e64b Fix missing dots in doc strings and some other doc string corrections.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 495
diff changeset
    26
460
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    27
from google.appengine.api import users
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    28
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    29
from django import forms
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    30
1014
508ad99368e2 soc/views/models/user.py now uses dynaform and appropriate cleaning methods.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 934
diff changeset
    31
from soc.logic import cleaning
460
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    32
from soc.logic import dicts
856
3d14b31e72e4 Set agrees_to_tos example text to link to site-wide ToS (or a warning message).
Todd Larsen <tlarsen@google.com>
parents: 813
diff changeset
    33
from soc.logic.models.site import logic as site_logic
3d14b31e72e4 Set agrees_to_tos example text to link to site-wide ToS (or a warning message).
Todd Larsen <tlarsen@google.com>
parents: 813
diff changeset
    34
from soc.logic.models.user import logic as user_logic
460
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    35
from soc.views import helper
1014
508ad99368e2 soc/views/models/user.py now uses dynaform and appropriate cleaning methods.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 934
diff changeset
    36
from soc.views.helper import access
891
3d40190f35b6 Move getToSLink() to soc.views.helper.redirects.getToSRedirect().
Todd Larsen <tlarsen@google.com>
parents: 858
diff changeset
    37
from soc.views.helper import redirects
1014
508ad99368e2 soc/views/models/user.py now uses dynaform and appropriate cleaning methods.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 934
diff changeset
    38
from soc.views.helper import widgets
460
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    39
from soc.views.models import base
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    40
549
00a9ce3dc082 Fix some broken help_text bubbles (they are truncated or not displayed if they
Todd Larsen <tlarsen@google.com>
parents: 547
diff changeset
    41
import soc.models.linkable
460
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    42
import soc.logic.models.user
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    43
import soc.views.helper
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    44
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    45
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    46
class View(base.View):
499
d22e4fe8e64b Fix missing dots in doc strings and some other doc string corrections.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 495
diff changeset
    47
  """View methods for the User model.
460
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    48
  """
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    49
547
be0de865ffc9 Fixed former_accounts detection by supplying the missing error message.
Todd Larsen <tlarsen@google.com>
parents: 546
diff changeset
    50
656
a76f1b443ea4 Cleanups in the views module
Sverre Rabbelier <srabbelier@gmail.com>
parents: 650
diff changeset
    51
  def __init__(self, params=None):
460
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    52
    """Defines the fields and methods required for the base View class
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    53
    to provide the user with list, public, create, edit and delete views.
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    54
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    55
    Params:
656
a76f1b443ea4 Cleanups in the views module
Sverre Rabbelier <srabbelier@gmail.com>
parents: 650
diff changeset
    56
      params: a dict with params for this View
460
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    57
    """
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    58
1014
508ad99368e2 soc/views/models/user.py now uses dynaform and appropriate cleaning methods.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 934
diff changeset
    59
    rights = access.Checker(params)
508ad99368e2 soc/views/models/user.py now uses dynaform and appropriate cleaning methods.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 934
diff changeset
    60
    rights['create'] = ['checkIsDeveloper']
508ad99368e2 soc/views/models/user.py now uses dynaform and appropriate cleaning methods.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 934
diff changeset
    61
    rights['edit'] = ['checkIsDeveloper']
508ad99368e2 soc/views/models/user.py now uses dynaform and appropriate cleaning methods.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 934
diff changeset
    62
    rights['delete'] = ['checkIsDeveloper']
508ad99368e2 soc/views/models/user.py now uses dynaform and appropriate cleaning methods.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 934
diff changeset
    63
    rights['list'] = ['checkIsDeveloper']
508ad99368e2 soc/views/models/user.py now uses dynaform and appropriate cleaning methods.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 934
diff changeset
    64
656
a76f1b443ea4 Cleanups in the views module
Sverre Rabbelier <srabbelier@gmail.com>
parents: 650
diff changeset
    65
    new_params = {}
a76f1b443ea4 Cleanups in the views module
Sverre Rabbelier <srabbelier@gmail.com>
parents: 650
diff changeset
    66
    new_params['logic'] = soc.logic.models.user.logic
1014
508ad99368e2 soc/views/models/user.py now uses dynaform and appropriate cleaning methods.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 934
diff changeset
    67
    new_params['rights'] = rights
508ad99368e2 soc/views/models/user.py now uses dynaform and appropriate cleaning methods.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 934
diff changeset
    68
    
656
a76f1b443ea4 Cleanups in the views module
Sverre Rabbelier <srabbelier@gmail.com>
parents: 650
diff changeset
    69
    new_params['name'] = "User"
460
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    70
1014
508ad99368e2 soc/views/models/user.py now uses dynaform and appropriate cleaning methods.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 934
diff changeset
    71
    new_params['edit_template'] = 'soc/user/edit.html'
460
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    72
656
a76f1b443ea4 Cleanups in the views module
Sverre Rabbelier <srabbelier@gmail.com>
parents: 650
diff changeset
    73
    new_params['sidebar_heading'] = 'Users'
542
7cc99461b64d Remove redundant dicts for URL patterns and sidebar menu text, and use the
Todd Larsen <tlarsen@google.com>
parents: 531
diff changeset
    74
1076
063194eaf87b Added agreed_to_tos_on field in user and role model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1047
diff changeset
    75
    new_params['extra_dynaexclude'] = ['former_accounts', 'agreed_to_tos',
1157
76e2ed09661c Added status property to the user model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1079
diff changeset
    76
        'agreed_to_tos_on', 'status']
1014
508ad99368e2 soc/views/models/user.py now uses dynaform and appropriate cleaning methods.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 934
diff changeset
    77
    new_params['create_extra_dynafields'] = {
508ad99368e2 soc/views/models/user.py now uses dynaform and appropriate cleaning methods.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 934
diff changeset
    78
        'clean_link_id': cleaning.clean_user_not_exist('link_id'),
508ad99368e2 soc/views/models/user.py now uses dynaform and appropriate cleaning methods.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 934
diff changeset
    79
        'clean_account': cleaning.clean_user_account_not_in_use('account')}
508ad99368e2 soc/views/models/user.py now uses dynaform and appropriate cleaning methods.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 934
diff changeset
    80
1157
76e2ed09661c Added status property to the user model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1079
diff changeset
    81
    # recreate the choices for the edit form
76e2ed09661c Added status property to the user model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1079
diff changeset
    82
    status_choices = []
76e2ed09661c Added status property to the user model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1079
diff changeset
    83
    for choice in user_logic.getModel().status.choices:
76e2ed09661c Added status property to the user model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1079
diff changeset
    84
      status_choices.append((choice, choice))
76e2ed09661c Added status property to the user model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1079
diff changeset
    85
1014
508ad99368e2 soc/views/models/user.py now uses dynaform and appropriate cleaning methods.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 934
diff changeset
    86
    new_params['edit_extra_dynafields'] = {
1030
a0081c626acb Style fixes in soc.views.models modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 1014
diff changeset
    87
        'link_id': forms.CharField(widget=widgets.ReadOnlyInput(),
1076
063194eaf87b Added agreed_to_tos_on field in user and role model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1047
diff changeset
    88
            required=True),
1079
be1aacb33b0f Changed clean_link_id to be in a wrapper form as well.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1076
diff changeset
    89
        'clean_link_id': cleaning.clean_link_id('link_id'),
1172
6404a939412c Style fixes in soc.views.models.user module.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 1159
diff changeset
    90
        'agreed_to_tos_on': forms.DateTimeField(
1159
3fefc88b0965 Fixes an error occurring when editing a User as Developer when the ToS have been signed.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1157
diff changeset
    91
            widget=widgets.ReadOnlyInput(attrs={'disabled':'true'}),
1076
063194eaf87b Added agreed_to_tos_on field in user and role model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1047
diff changeset
    92
            required=False),
1172
6404a939412c Style fixes in soc.views.models.user module.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 1159
diff changeset
    93
        'status': forms.ChoiceField(choices=status_choices),
1014
508ad99368e2 soc/views/models/user.py now uses dynaform and appropriate cleaning methods.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 934
diff changeset
    94
        'clean_account': cleaning.clean_user_account('account'),
1030
a0081c626acb Style fixes in soc.views.models modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 1014
diff changeset
    95
        'clean': cleaning.validate_user_edit('link_id', 'account'),
1014
508ad99368e2 soc/views/models/user.py now uses dynaform and appropriate cleaning methods.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 934
diff changeset
    96
    }
1076
063194eaf87b Added agreed_to_tos_on field in user and role model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1047
diff changeset
    97
656
a76f1b443ea4 Cleanups in the views module
Sverre Rabbelier <srabbelier@gmail.com>
parents: 650
diff changeset
    98
    params = dicts.merge(params, new_params)
460
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    99
656
a76f1b443ea4 Cleanups in the views module
Sverre Rabbelier <srabbelier@gmail.com>
parents: 650
diff changeset
   100
    super(View, self).__init__(params=params)
460
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
   101
543
280a1ac6bcc1 Merge soc/logic/out_of_band.py into soc/views/out_of_band.py. Merge
Todd Larsen <tlarsen@google.com>
parents: 542
diff changeset
   102
479
50bab5e71a66 Make sure the user edit form has the complete mail adress in the user account field when opened. Replace confusing id field in form with email field. Editing the email adress of an existing user will still result in an error but that should be fixed soon.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 473
diff changeset
   103
  def _editGet(self, request, entity, form):
50bab5e71a66 Make sure the user edit form has the complete mail adress in the user account field when opened. Replace confusing id field in form with email field. Editing the email adress of an existing user will still result in an error but that should be fixed soon.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 473
diff changeset
   104
    """See base.View._editGet().
50bab5e71a66 Make sure the user edit form has the complete mail adress in the user account field when opened. Replace confusing id field in form with email field. Editing the email adress of an existing user will still result in an error but that should be fixed soon.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 473
diff changeset
   105
    """
662
0e89b027b140 Make use of the new generic key_name by lookup up scope_path
Sverre Rabbelier <srabbelier@gmail.com>
parents: 656
diff changeset
   106
479
50bab5e71a66 Make sure the user edit form has the complete mail adress in the user account field when opened. Replace confusing id field in form with email field. Editing the email adress of an existing user will still result in an error but that should be fixed soon.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 473
diff changeset
   107
    # fill in the email field with the data from the entity
1190
449b9d93d890 Probably fixed a bug on the live instance.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1172
diff changeset
   108
    form.fields['account'].initial = entity.account.email
1076
063194eaf87b Added agreed_to_tos_on field in user and role model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1047
diff changeset
   109
    form.fields['agreed_to_tos_on'].initial = entity.agreed_to_tos_on
063194eaf87b Added agreed_to_tos_on field in user and role model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1047
diff changeset
   110
    form.fields['agreed_to_tos_on'].example_text = self._getToSExampleText()
1157
76e2ed09661c Added status property to the user model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1079
diff changeset
   111
    form.fields['status'].initial = entity.status
460
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
   112
662
0e89b027b140 Make use of the new generic key_name by lookup up scope_path
Sverre Rabbelier <srabbelier@gmail.com>
parents: 656
diff changeset
   113
    super(View, self)._editGet(request, entity, form)
0e89b027b140 Make use of the new generic key_name by lookup up scope_path
Sverre Rabbelier <srabbelier@gmail.com>
parents: 656
diff changeset
   114
1047
26fade94886b Changed the Terms Of Service boolean so that it is None as long as the user owning the account has not Agreed to it.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1042
diff changeset
   115
1076
063194eaf87b Added agreed_to_tos_on field in user and role model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1047
diff changeset
   116
  def _getToSExampleText(self):
856
3d14b31e72e4 Set agrees_to_tos example text to link to site-wide ToS (or a warning message).
Todd Larsen <tlarsen@google.com>
parents: 813
diff changeset
   117
    """Returns example_text linking to site-wide ToS, or a warning message.
3d14b31e72e4 Set agrees_to_tos example text to link to site-wide ToS (or a warning message).
Todd Larsen <tlarsen@google.com>
parents: 813
diff changeset
   118
    """
891
3d40190f35b6 Move getToSLink() to soc.views.helper.redirects.getToSRedirect().
Todd Larsen <tlarsen@google.com>
parents: 858
diff changeset
   119
    tos_link = redirects.getToSRedirect(site_logic.getSingleton())
856
3d14b31e72e4 Set agrees_to_tos example text to link to site-wide ToS (or a warning message).
Todd Larsen <tlarsen@google.com>
parents: 813
diff changeset
   120
3d14b31e72e4 Set agrees_to_tos example text to link to site-wide ToS (or a warning message).
Todd Larsen <tlarsen@google.com>
parents: 813
diff changeset
   121
    if not tos_link:
3d14b31e72e4 Set agrees_to_tos example text to link to site-wide ToS (or a warning message).
Todd Larsen <tlarsen@google.com>
parents: 813
diff changeset
   122
      return ('<div class="notice">&nbsp;<i>No site-wide</i> Terms of'
3d14b31e72e4 Set agrees_to_tos example text to link to site-wide ToS (or a warning message).
Todd Larsen <tlarsen@google.com>
parents: 813
diff changeset
   123
              ' Service <i>are currently set!</i>&nbsp;</div>')
3d14b31e72e4 Set agrees_to_tos example text to link to site-wide ToS (or a warning message).
Todd Larsen <tlarsen@google.com>
parents: 813
diff changeset
   124
3d14b31e72e4 Set agrees_to_tos example text to link to site-wide ToS (or a warning message).
Todd Larsen <tlarsen@google.com>
parents: 813
diff changeset
   125
    return ('<i>current site-wide <b><a href=%s>Terms of Service</a></b></i>'
3d14b31e72e4 Set agrees_to_tos example text to link to site-wide ToS (or a warning message).
Todd Larsen <tlarsen@google.com>
parents: 813
diff changeset
   126
            % tos_link)
3d14b31e72e4 Set agrees_to_tos example text to link to site-wide ToS (or a warning message).
Todd Larsen <tlarsen@google.com>
parents: 813
diff changeset
   127
3d14b31e72e4 Set agrees_to_tos example text to link to site-wide ToS (or a warning message).
Todd Larsen <tlarsen@google.com>
parents: 813
diff changeset
   128
460
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
   129
view = View()
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
   130
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
   131
create = view.create
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
   132
delete = view.delete
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
   133
edit = view.edit
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
   134
list = view.list
3a508b1ebaac Added a generic user page
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
   135
public = view.public
858
e79e7a22326f Add an export() view, and implement it as text/text for Document.
Todd Larsen <tlarsen@google.com>
parents: 856
diff changeset
   136
export = view.export
934
9fcc08971efe Add a 'pick' view to the appropriate views
Sverre Rabbelier <srabbelier@gmail.com>
parents: 891
diff changeset
   137
pick = view.pick