app/urls.py
author Todd Larsen <tlarsen@google.com>
Sat, 04 Oct 2008 04:34:16 +0000
changeset 276 56357a92c110
parent 252 112f36f4598f
child 284 44abd20296ce
permissions -rw-r--r--
Move helpers/html_menu.py to helper/html_menu.py, to clear out soc/views/helpers for deletion. Patch by: Todd Larsen Review by: to-be-reviewed
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
31
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     1
# Copyright 2008 the Melange authors.
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     2
#
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     3
# Licensed under the Apache License, Version 2.0 (the "License");
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     4
# you may not use this file except in compliance with the License.
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     5
# You may obtain a copy of the License at
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     6
#
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     7
#     http://www.apache.org/licenses/LICENSE-2.0
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     8
#
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     9
# Unless required by applicable law or agreed to in writing, software
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    10
# distributed under the License is distributed on an "AS IS" BASIS,
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    11
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    12
# See the License for the specific language governing permissions and
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    13
# limitations under the License.
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    14
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    15
__authors__ = [
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    16
  '"Augie Fackler" <durin42@gmail.com>',
79
58001ec7720c Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 66
diff changeset
    17
  '"Pawel Solyga" <pawel.solyga@gmail.com>',
31
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    18
  ]
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    19
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    20
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    21
from django.conf.urls.defaults import *
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    22
252
112f36f4598f Change key_name module usage to path_linkname module (fix to previous commit). Add comments about urls. Add Sponsor views urls for upcoming Sponsor views modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 241
diff changeset
    23
from soc.logic import path_linkname
226
a92b11181a49 Update some of the URL patterns to get their link_name parsing from the new
Todd Larsen <tlarsen@google.com>
parents: 205
diff changeset
    24
31
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    25
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    26
urlpatterns = patterns(
252
112f36f4598f Change key_name module usage to path_linkname module (fix to previous commit). Add comments about urls. Add Sponsor views urls for upcoming Sponsor views modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 241
diff changeset
    27
    # Home Page view
31
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    28
    '',
79
58001ec7720c Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 66
diff changeset
    29
    (r'^$', 'soc.views.site.home.public'),
252
112f36f4598f Change key_name module usage to path_linkname module (fix to previous commit). Add comments about urls. Add Sponsor views urls for upcoming Sponsor views modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 241
diff changeset
    30
    
112f36f4598f Change key_name module usage to path_linkname module (fix to previous commit). Add comments about urls. Add Sponsor views urls for upcoming Sponsor views modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 241
diff changeset
    31
    # Home Page Site views
141
e120c24b89e2 Added Melange front page edit view where you can change title, content, feed url. Created SiteSettings and Document models and some logic for them. Added isFeedURLValid function in soc/logic/feed.py. Created some functions for handling datastore updates of different kinds of Models (soc/logic/model.py). Fixed some typos and too long lines of code.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 132
diff changeset
    32
    (r'^site/home$', 'soc.views.site.home.public'),
e120c24b89e2 Added Melange front page edit view where you can change title, content, feed url. Created SiteSettings and Document models and some logic for them. Added isFeedURLValid function in soc/logic/feed.py. Created some functions for handling datastore updates of different kinds of Models (soc/logic/model.py). Fixed some typos and too long lines of code.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 132
diff changeset
    33
    (r'^site/home/edit$', 'soc.views.site.home.edit'),
84
1b31d238ba39 Flesh out the user/roles placeholders a little bit more.
Todd Larsen <tlarsen@google.com>
parents: 83
diff changeset
    34
132
15d89c284106 Add a /site/user/lookup view that provides Developers with a form to look up
Todd Larsen <tlarsen@google.com>
parents: 86
diff changeset
    35
    # TODO(tlarsen): uncomment these when the view functions are committed
84
1b31d238ba39 Flesh out the user/roles placeholders a little bit more.
Todd Larsen <tlarsen@google.com>
parents: 83
diff changeset
    36
    # attempt to send User to their dashboard
1b31d238ba39 Flesh out the user/roles placeholders a little bit more.
Todd Larsen <tlarsen@google.com>
parents: 83
diff changeset
    37
    # (will display soc.views.user.roles.public() if "linkname" is not
1b31d238ba39 Flesh out the user/roles placeholders a little bit more.
Todd Larsen <tlarsen@google.com>
parents: 83
diff changeset
    38
    # current logged-in User)    
132
15d89c284106 Add a /site/user/lookup view that provides Developers with a form to look up
Todd Larsen <tlarsen@google.com>
parents: 86
diff changeset
    39
    # (r'^user/roles$',
15d89c284106 Add a /site/user/lookup view that provides Developers with a form to look up
Todd Larsen <tlarsen@google.com>
parents: 86
diff changeset
    40
    #  'soc.views.user.roles.dashboard'),
15d89c284106 Add a /site/user/lookup view that provides Developers with a form to look up
Todd Larsen <tlarsen@google.com>
parents: 86
diff changeset
    41
    # (r'^user/roles/(?P<linkname>[_0-9a-z]+)$',
15d89c284106 Add a /site/user/lookup view that provides Developers with a form to look up
Todd Larsen <tlarsen@google.com>
parents: 86
diff changeset
    42
    #  'soc.views.user.roles.dashboard'),
252
112f36f4598f Change key_name module usage to path_linkname module (fix to previous commit). Add comments about urls. Add Sponsor views urls for upcoming Sponsor views modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 241
diff changeset
    43
    
112f36f4598f Change key_name module usage to path_linkname module (fix to previous commit). Add comments about urls. Add Sponsor views urls for upcoming Sponsor views modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 241
diff changeset
    44
    # User Profile Site views
132
15d89c284106 Add a /site/user/lookup view that provides Developers with a form to look up
Todd Larsen <tlarsen@google.com>
parents: 86
diff changeset
    45
    (r'^site/user/lookup$', 'soc.views.site.user.profile.lookup'),
205
4a86df751222 Fixed not working "Create New User" view which was caused by adding key_name into User Edit Developer view. This commit divides edit() view function in soc.views.site.user.profile into edit() and create() request handlers. New create() request handler is used only in "Create New User" view and has specific form validation functions and uses updateOrCreateUserFromId() instead of updateUserForKeyName().
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 186
diff changeset
    46
    (r'^site/user/profile$', 'soc.views.site.user.profile.create'),
252
112f36f4598f Change key_name module usage to path_linkname module (fix to previous commit). Add comments about urls. Add Sponsor views urls for upcoming Sponsor views modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 241
diff changeset
    47
    (r'^site/user/profile/%s$' % path_linkname.LINKNAME_ARG_PATTERN,
141
e120c24b89e2 Added Melange front page edit view where you can change title, content, feed url. Created SiteSettings and Document models and some logic for them. Added isFeedURLValid function in soc/logic/feed.py. Created some functions for handling datastore updates of different kinds of Models (soc/logic/model.py). Fixed some typos and too long lines of code.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 132
diff changeset
    48
     'soc.views.site.user.profile.edit'),
186
da76f08b1752 Add Users List Developer view which is available at /site/user/list. Add User list custom templates which are used with list_helpers. Add "Users List" link in base.html template.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 170
diff changeset
    49
    (r'^site/user/list$', 'soc.views.site.user.list.all'),
226
a92b11181a49 Update some of the URL patterns to get their link_name parsing from the new
Todd Larsen <tlarsen@google.com>
parents: 205
diff changeset
    50
252
112f36f4598f Change key_name module usage to path_linkname module (fix to previous commit). Add comments about urls. Add Sponsor views urls for upcoming Sponsor views modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 241
diff changeset
    51
    # Document views
112f36f4598f Change key_name module usage to path_linkname module (fix to previous commit). Add comments about urls. Add Sponsor views urls for upcoming Sponsor views modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 241
diff changeset
    52
    (r'^docs/show/%s$' % path_linkname.PATH_LINKNAME_ARGS_PATTERN,
240
dd0497f6da41 URL pattern changes that were missed by r671.
Todd Larsen <tlarsen@google.com>
parents: 227
diff changeset
    53
     'soc.views.docs.show.public'),
252
112f36f4598f Change key_name module usage to path_linkname module (fix to previous commit). Add comments about urls. Add Sponsor views urls for upcoming Sponsor views modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 241
diff changeset
    54
    
112f36f4598f Change key_name module usage to path_linkname module (fix to previous commit). Add comments about urls. Add Sponsor views urls for upcoming Sponsor views modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 241
diff changeset
    55
    # Document Site views
226
a92b11181a49 Update some of the URL patterns to get their link_name parsing from the new
Todd Larsen <tlarsen@google.com>
parents: 205
diff changeset
    56
    (r'^site/docs/edit$', 'soc.views.site.docs.edit.create'),
252
112f36f4598f Change key_name module usage to path_linkname module (fix to previous commit). Add comments about urls. Add Sponsor views urls for upcoming Sponsor views modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 241
diff changeset
    57
    (r'^site/docs/edit/%s$' % path_linkname.PATH_LINKNAME_ARGS_PATTERN,
226
a92b11181a49 Update some of the URL patterns to get their link_name parsing from the new
Todd Larsen <tlarsen@google.com>
parents: 205
diff changeset
    58
     'soc.views.site.docs.edit.edit'),
a92b11181a49 Update some of the URL patterns to get their link_name parsing from the new
Todd Larsen <tlarsen@google.com>
parents: 205
diff changeset
    59
    (r'^site/docs/list$', 'soc.views.site.docs.list.all'),
186
da76f08b1752 Add Users List Developer view which is available at /site/user/list. Add User list custom templates which are used with list_helpers. Add "Users List" link in base.html template.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 170
diff changeset
    60
    
252
112f36f4598f Change key_name module usage to path_linkname module (fix to previous commit). Add comments about urls. Add Sponsor views urls for upcoming Sponsor views modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 241
diff changeset
    61
    # Sponsor Group public view
112f36f4598f Change key_name module usage to path_linkname module (fix to previous commit). Add comments about urls. Add Sponsor views urls for upcoming Sponsor views modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 241
diff changeset
    62
    (r'^sponsor/profile/%s' % path_linkname.LINKNAME_ARG_PATTERN,
112f36f4598f Change key_name module usage to path_linkname module (fix to previous commit). Add comments about urls. Add Sponsor views urls for upcoming Sponsor views modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 241
diff changeset
    63
     'soc.views.sponsor.profile.public'),
186
da76f08b1752 Add Users List Developer view which is available at /site/user/list. Add User list custom templates which are used with list_helpers. Add "Users List" link in base.html template.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 170
diff changeset
    64
    
252
112f36f4598f Change key_name module usage to path_linkname module (fix to previous commit). Add comments about urls. Add Sponsor views urls for upcoming Sponsor views modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 241
diff changeset
    65
    # Sponsor Group Site views
112f36f4598f Change key_name module usage to path_linkname module (fix to previous commit). Add comments about urls. Add Sponsor views urls for upcoming Sponsor views modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 241
diff changeset
    66
    (r'^site/sponsor/profile$', 'soc.views.site.sponsor.profile.edit'),
112f36f4598f Change key_name module usage to path_linkname module (fix to previous commit). Add comments about urls. Add Sponsor views urls for upcoming Sponsor views modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 241
diff changeset
    67
    (r'^site/sponsor/profile/%s' % path_linkname.LINKNAME_ARG_PATTERN,
112f36f4598f Change key_name module usage to path_linkname module (fix to previous commit). Add comments about urls. Add Sponsor views urls for upcoming Sponsor views modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 241
diff changeset
    68
     'soc.views.site.sponsor.profile.edit'),
112f36f4598f Change key_name module usage to path_linkname module (fix to previous commit). Add comments about urls. Add Sponsor views urls for upcoming Sponsor views modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 241
diff changeset
    69
    (r'^site/sponsor/list$', 'soc.views.site.sponsor.list.all'),
112f36f4598f Change key_name module usage to path_linkname module (fix to previous commit). Add comments about urls. Add Sponsor views urls for upcoming Sponsor views modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 241
diff changeset
    70
    
112f36f4598f Change key_name module usage to path_linkname module (fix to previous commit). Add comments about urls. Add Sponsor views urls for upcoming Sponsor views modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 241
diff changeset
    71
    # User Profile views
86
fd34dd071e5e Fix up the URLs mapping to soc.views.user.profile.edit() and make the site base
Todd Larsen <tlarsen@google.com>
parents: 84
diff changeset
    72
    (r'^user/profile$', 'soc.views.user.profile.edit'),
252
112f36f4598f Change key_name module usage to path_linkname module (fix to previous commit). Add comments about urls. Add Sponsor views urls for upcoming Sponsor views modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 241
diff changeset
    73
    (r'^user/profile/%s$' % path_linkname.LINKNAME_ARG_PATTERN,
86
fd34dd071e5e Fix up the URLs mapping to soc.views.user.profile.edit() and make the site base
Todd Larsen <tlarsen@google.com>
parents: 84
diff changeset
    74
     'soc.views.user.profile.edit'),
84
1b31d238ba39 Flesh out the user/roles placeholders a little bit more.
Todd Larsen <tlarsen@google.com>
parents: 83
diff changeset
    75
226
a92b11181a49 Update some of the URL patterns to get their link_name parsing from the new
Todd Larsen <tlarsen@google.com>
parents: 205
diff changeset
    76
    # these are not really used...
66
8c86470746fc Finished migrating the "proto" app (which only contained a Person profile edit
Todd Larsen <tlarsen@google.com>
parents: 54
diff changeset
    77
    (r'^org/profile/(?P<program>ghop[_0-9a-z]+)/(?P<linkname>[_0-9a-z]+)/$',
8c86470746fc Finished migrating the "proto" app (which only contained a Person profile edit
Todd Larsen <tlarsen@google.com>
parents: 54
diff changeset
    78
     'soc.views.person.profile.edit',
8c86470746fc Finished migrating the "proto" app (which only contained a Person profile edit
Todd Larsen <tlarsen@google.com>
parents: 54
diff changeset
    79
     {'template': 'ghop/person/profile/edit.html'}),
8c86470746fc Finished migrating the "proto" app (which only contained a Person profile edit
Todd Larsen <tlarsen@google.com>
parents: 54
diff changeset
    80
    (r'^org/profile/(?P<program>[_0-9a-z]+)/(?P<linkname>[_0-9a-z]+)/$',
8c86470746fc Finished migrating the "proto" app (which only contained a Person profile edit
Todd Larsen <tlarsen@google.com>
parents: 54
diff changeset
    81
     'soc.views.person.profile.edit'),
31
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    82
)