# HG changeset patch # User Todd Larsen # Date 1227207030 0 # Node ID aae25d2b44647caa4d64747e60228d9b7dedf5c0 # Parent 52557918ec8f06ba28805facdb4c5a7ed7c25ea2 Rename link_name to link_id everywhere, regardless of case (so LINK_NAME becomes LINK_ID, "link name" becomes "link id", etc.). Also, rename LINKNAME to LINK_ID. Patch by: Todd Larsen diff -r 52557918ec8f -r aae25d2b4464 app/soc/logic/accounts.py --- a/app/soc/logic/accounts.py Thu Nov 20 18:06:43 2008 +0000 +++ b/app/soc/logic/accounts.py Thu Nov 20 18:50:30 2008 +0000 @@ -113,17 +113,17 @@ # TODO(tlarsen): make this generic for any Linkable and move elsewhere -def getUserFromLinkNameOr404(link_name): - """Like getUserFromLinkName but expects to find a user. +def getUserFromLinkIdOr404(link_id): + """Like getUserFromLinkId but expects to find a user. Raises: out_of_band.ErrorResponse if no User entity is found """ - user = models.user.logic.getForFields({'link_name': link_name}, + user = models.user.logic.getForFields({'link_id': link_id}, unique=True) if user: return user raise out_of_band.ErrorResponse( - 'There is no user with a "link name" of "%s".' % link_name, status=404) + 'There is no user with a "link ID" of "%s".' % link_id, status=404) diff -r 52557918ec8f -r aae25d2b4464 app/soc/logic/key_name.py --- a/app/soc/logic/key_name.py Thu Nov 20 18:06:43 2008 +0000 +++ b/app/soc/logic/key_name.py Thu Nov 20 18:50:30 2008 +0000 @@ -31,24 +31,24 @@ pass -def nameDocument(partial_path, link_name=None): - """Returns a Document key name constructed from a path and link name. +def nameDocument(partial_path, link_id=None): + """Returns a Document key name constructed from a path and link ID. Args: partial_path: the first portion of the path to the Document that uniquely identifies it - link_name: optional link name to append to path (when omitted, - partial_path is actually the entire path, with the link_name already + link_id: optional link ID to append to path (when omitted, + partial_path is actually the entire path, with the link_id already appended) Raises: - Error if partial_path and link_Name produce a "False" path (None, + Error if partial_path and link_id produce a "False" path (None, empty string, etc.) """ path = [partial_path] - if link_name: - path.append(link_name) + if link_id: + path.append(link_id) path = path_link_name.combinePath(path) @@ -58,7 +58,7 @@ return 'Document:%s' % path -def nameSiteSettings(partial_path, link_name): +def nameSiteSettings(partial_path, link_id): """Returns a SiteSettings key name constructed from a supplied path. Raises: @@ -68,13 +68,13 @@ if not partial_path: raise Error('"partial_path" must be non-False: "%s"' % partial_path) - if not link_name: - raise Error('"link_name" must be non-False: "%s"' % link_name) + if not link_id: + raise Error('"link_id" must be non-False: "%s"' % link_id) - return 'SiteSettings:%s:%s' % (partial_path, link_name) + return 'SiteSettings:%s:%s' % (partial_path, link_id) -def nameHomeSettings(partial_path, link_name): +def nameHomeSettings(partial_path, link_id): """Returns a HomeSettings key name constructed from a supplied path. Raises: @@ -84,10 +84,10 @@ if not partial_path: raise Error('"partial_path" must be non-False: "%s"' % partial_path) - if not link_name: - raise Error('"link_name" must be non-False: "%s"' % link_name) + if not link_id: + raise Error('"link_id" must be non-False: "%s"' % link_id) - return 'HomeSettings:%s:%s' % (partial_path, link_name) + return 'HomeSettings:%s:%s' % (partial_path, link_id) def nameUser(email): @@ -102,31 +102,31 @@ return 'User:%s' % email -def nameSponsor(link_name): - """Returns a Sponsor key name constructed from a supplied link name. +def nameSponsor(link_id): + """Returns a Sponsor key name constructed from a supplied link ID. Raises: - Error if link_name is "False" (None, empty string, etc.) + Error if link_id is "False" (None, empty string, etc.) """ - if not link_name: - raise Error('"link_name" must be non-False: "%s"' % link_name) + if not link_id: + raise Error('"link_id" must be non-False: "%s"' % link_id) - return 'Group/Sponsor:%s' % link_name + return 'Group/Sponsor:%s' % link_id -def nameSchool(sponsor_ln, program_ln, link_name): - """Returns a School key name constructed from link names. +def nameSchool(sponsor_ln, program_ln, link_id): + """Returns a School key name constructed from link IDs. Args: - sponsor_ln: Sponsor link name - program_ln: Program link name - link_name: School link name + sponsor_ln: Sponsor link ID + program_ln: Program link ID + link_id: School link ID Raises: - Error if sponsor_ln, program_ln, and link_Name combine to produce + Error if sponsor_ln, program_ln, and link_id combine to produce a "False" path (None, empty string, etc.) """ - path = path_link_name.combinePath([[sponsor_ln, program_ln], link_name]) + path = path_link_name.combinePath([[sponsor_ln, program_ln], link_id]) if not path: raise Error('"path" must be non-False: "%s"' % path) @@ -134,19 +134,19 @@ return 'Group/School:%s' % path -def nameOrganization(sponsor_ln, program_ln, link_name): - """Returns a Organization key name constructed from link names. +def nameOrganization(sponsor_ln, program_ln, link_id): + """Returns a Organization key name constructed from link IDs. Args: - sponsor_ln: Sponsor link name - program_ln: Program link name - link_name: Organization link name + sponsor_ln: Sponsor link ID + program_ln: Program link ID + link_id: Organization link ID Raises: - Error if sponsor_ln, program_ln, and link_Name combine to produce + Error if sponsor_ln, program_ln, and link_id combine to produce a "False" path (None, empty string, etc.) """ - path = path_link_name.combinePath([[sponsor_ln, program_ln], link_name]) + path = path_link_name.combinePath([[sponsor_ln, program_ln], link_id]) if not path: raise Error('"path" must be non-False: "%s"' % path) @@ -154,26 +154,26 @@ return 'Group/Organization:%s' % path -def nameClub(link_name): - """Returns a Club key name constructed from a supplied link name. +def nameClub(link_id): + """Returns a Club key name constructed from a supplied link ID. Raises: - Error if link_name is "False" (None, empty string, etc.) + Error if link_id is "False" (None, empty string, etc.) """ - if not link_name: - raise Error('"link_name" must be non-False: "%s"' % link_name) + if not link_id: + raise Error('"link_id" must be non-False: "%s"' % link_id) - return 'Group/Club:%s' % link_name + return 'Group/Club:%s' % link_id -def nameWork(link_name): +def nameWork(link_id): """Placeholder for work namer. """ - if not link_name: - raise Error('"link_name" must be non-False: "%s"' % link_name) + if not link_id: + raise Error('"link_id" must be non-False: "%s"' % link_id) - return 'Work:%s' % link_name + return 'Work:%s' % link_id def nameHost(sponsor_ln, user_ln): diff -r 52557918ec8f -r aae25d2b4464 app/soc/logic/models/base.py --- a/app/soc/logic/models/base.py Thu Nov 20 18:06:43 2008 +0000 +++ b/app/soc/logic/models/base.py Thu Nov 20 18:50:30 2008 +0000 @@ -208,7 +208,7 @@ return entity def getIfFields(self, fields): - """Returns entity for supplied link name if one exists. + """Returns entity for supplied link ID if one exists. Args: fields: the fields of the entity that uniquely identifies it @@ -218,18 +218,18 @@ * Entity for supplied fields Raises: - out_of_band.ErrorResponse if link name is not false, but no entity - with the supplied link name exists in the Datastore. + out_of_band.ErrorResponse if link ID is not false, but no entity + with the supplied link ID exists in the Datastore. """ if not all(fields.values()): - # exit without error, to let view know that link_name was not supplied + # exit without error, to let view know that link_id was not supplied return None entity = self.getFromFields(**fields) if entity: - # an entity exist for this link_name, so return that entity + # an entity exist for this link_id, so return that entity return entity format_text = ugettext_lazy('"%(key)s" is "%(value)s"') diff -r 52557918ec8f -r aae25d2b4464 app/soc/logic/models/document.py --- a/app/soc/logic/models/document.py Thu Nov 20 18:06:43 2008 +0000 +++ b/app/soc/logic/models/document.py Thu Nov 20 18:50:30 2008 +0000 @@ -43,19 +43,19 @@ """See base.Logic.getKeyNameValues. """ - return [entity.partial_path, entity.link_name] + return [entity.partial_path, entity.link_id] def getKeyValuesFromFields(self, fields): """See base.Logic.getKeyValuesFromFields. """ - return [fields['partial_path'], fields['link_name']] + return [fields['partial_path'], fields['link_id']] def getKeyFieldNames(self): """See base.Logic.getKeyFieldNames. """ - return ['partial_path', 'link_name'] + return ['partial_path', 'link_id'] logic = Logic() diff -r 52557918ec8f -r aae25d2b4464 app/soc/logic/models/home_settings.py --- a/app/soc/logic/models/home_settings.py Thu Nov 20 18:06:43 2008 +0000 +++ b/app/soc/logic/models/home_settings.py Thu Nov 20 18:50:30 2008 +0000 @@ -42,18 +42,18 @@ """See base.Logic.getKeyNameValues. """ - return [entity.partial_path, entity.link_name] + return [entity.partial_path, entity.link_id] def getKeyValuesFromFields(self, fields): """See base.Logic.getKeyValuesFromFields. """ - return [fields['partial_path'], fields['link_name']] + return [fields['partial_path'], fields['link_id']] def getKeyFieldNames(self): """See base.Logic.getKeyFieldNames. """ - return ['partial_path', 'link_name'] + return ['partial_path', 'link_id'] logic = Logic() diff -r 52557918ec8f -r aae25d2b4464 app/soc/logic/models/host.py --- a/app/soc/logic/models/host.py Thu Nov 20 18:06:43 2008 +0000 +++ b/app/soc/logic/models/host.py Thu Nov 20 18:50:30 2008 +0000 @@ -43,7 +43,7 @@ """See base.Logic.getKeyNameValues. """ - return [entity.sponsor.link_name, entity.user.link_name] + return [entity.sponsor.link_id, entity.user.link_id] def getKeyValuesFromFields(self, fields): """See base.Logic.getKeyValuesFromFields. diff -r 52557918ec8f -r aae25d2b4464 app/soc/logic/models/request.py --- a/app/soc/logic/models/request.py Thu Nov 20 18:06:43 2008 +0000 +++ b/app/soc/logic/models/request.py Thu Nov 20 18:50:30 2008 +0000 @@ -42,7 +42,7 @@ """See base.Logic.getKeyNameValues. """ - return [entity.role, entity.to.link_name, entity.requester.link_name] + return [entity.role, entity.to.link_id, entity.requester.link_id] def getKeyValuesFromFields(self, fields): """See base.Logic.getKeyValuesFromFields. diff -r 52557918ec8f -r aae25d2b4464 app/soc/logic/models/site_settings.py --- a/app/soc/logic/models/site_settings.py Thu Nov 20 18:06:43 2008 +0000 +++ b/app/soc/logic/models/site_settings.py Thu Nov 20 18:50:30 2008 +0000 @@ -35,8 +35,8 @@ """ DEF_SITE_SETTINGS_PARTIAL_PATH = 'site' - DEF_SITE_SETTINGS_LINK_NAME = 'home' - DEF_SITE_HOME_DOC_LINK_NAME = 'home' + DEF_SITE_SETTINGS_LINK_ID = 'home' + DEF_SITE_HOME_DOC_LINK_ID = 'home' def __init__(self): """Defines the name, key_name and model for this entity. @@ -49,7 +49,7 @@ """ return [self.DEF_SITE_SETTINGS_PARTIAL_PATH, - self.DEF_SITE_SETTINGS_LINK_NAME] + self.DEF_SITE_SETTINGS_LINK_ID] logic = Logic() diff -r 52557918ec8f -r aae25d2b4464 app/soc/logic/models/sponsor.py --- a/app/soc/logic/models/sponsor.py Thu Nov 20 18:06:43 2008 +0000 +++ b/app/soc/logic/models/sponsor.py Thu Nov 20 18:50:30 2008 +0000 @@ -43,19 +43,19 @@ """See base.Logic.getKeyNameValues. """ - return [entity.link_name] + return [entity.link_id] def getKeyValuesFromFields(self, fields): """See base.Logic.getKeyValuesFromFields. """ - return [fields['link_name']] + return [fields['link_id']] def getKeyFieldNames(self): """See base.Logic.getKeyFieldNames. """ - return ['link_name'] + return ['link_id'] def isDeletable(self, entity): diff -r 52557918ec8f -r aae25d2b4464 app/soc/logic/models/user.py --- a/app/soc/logic/models/user.py Thu Nov 20 18:06:43 2008 +0000 +++ b/app/soc/logic/models/user.py Thu Nov 20 18:50:30 2008 +0000 @@ -54,25 +54,25 @@ """See base.Logic.getKeyValues. """ - return [entity.link_name] + return [entity.link_id] def getSuffixValues(self, entity): """See base.Logic.getSuffixValues. """ - return [entity.link_name] + return [entity.link_id] def getKeyValuesFromFields(self, fields): """See base.Logic.getKeyValuesFromFields. """ - return [fields['link_name']] + return [fields['link_id']] def getKeyFieldNames(self): """See base.Logic.getKeyFieldNames. """ - return ['link_name'] + return ['link_id'] def updateOrCreateFromAccount(self, properties, account): """Like updateOrCreateFromKeyName, but resolves account to key_name first. @@ -85,7 +85,7 @@ key_name = user.key().name() else: raise - key_name = self.getKeyNameForFields({'link_name': properties['link_name']}) + key_name = self.getKeyNameForFields({'link_id': properties['link_id']}) return self.updateOrCreateFromKeyName(properties, key_name) diff -r 52557918ec8f -r aae25d2b4464 app/soc/logic/models/work.py --- a/app/soc/logic/models/work.py Thu Nov 20 18:06:43 2008 +0000 +++ b/app/soc/logic/models/work.py Thu Nov 20 18:50:30 2008 +0000 @@ -42,19 +42,19 @@ """See base.Logic.getKeyNameValues. """ - return [entity.link_name] + return [entity.link_id] def getKeyValuesFromFields(self, fields): """See base.Logic.getKeyValuesFromFields. """ - return [fields['link_name']] + return [fields['link_id']] def getKeyFieldNames(self): """See base.Logic.getKeyFieldNames. """ - return ['link_name'] + return ['link_id'] logic = Logic() diff -r 52557918ec8f -r aae25d2b4464 app/soc/logic/path_link_name.py --- a/app/soc/logic/path_link_name.py Thu Nov 20 18:06:43 2008 +0000 +++ b/app/soc/logic/path_link_name.py Thu Nov 20 18:50:30 2008 +0000 @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Path and link name manipulation functions. +"""Path and link ID manipulation functions. """ __authors__ = [ @@ -31,42 +31,42 @@ # -OR- # underscore and ASCII digit or lowercase) # zero or more of OR group -LINKNAME_PATTERN_CORE = r'[0-9a-z](?:[0-9a-z]|_[0-9a-z])*' -LINKNAME_ARG_PATTERN = r'(?P%s)' % LINKNAME_PATTERN_CORE -LINKNAME_PATTERN = r'^%s$' % LINKNAME_PATTERN_CORE -LINKNAME_REGEX = re.compile(LINKNAME_PATTERN) +LINK_ID_PATTERN_CORE = r'[0-9a-z](?:[0-9a-z]|_[0-9a-z])*' +LINK_ID_ARG_PATTERN = r'(?P%s)' % LINK_ID_PATTERN_CORE +LINK_ID_PATTERN = r'^%s$' % LINK_ID_PATTERN_CORE +LINK_ID_REGEX = re.compile(LINK_ID_PATTERN) -# partial path is multiple link_name chunks, +# partial path is multiple link_id chunks, # each separated by a trailing / # (at least 1) -PARTIAL_PATH_ARG_PATTERN = (r'(?P%(link_name)s' - '(?:/%(link_name)s)*)' % { - 'link_name': LINKNAME_PATTERN_CORE}) +PARTIAL_PATH_ARG_PATTERN = (r'(?P%(link_id)s' + '(?:/%(link_id)s)*)' % { + 'link_id': LINK_ID_PATTERN_CORE}) PARTIAL_PATH_PATTERN = r'^%s$' % PARTIAL_PATH_ARG_PATTERN PARTIAL_PATH_REGEX = re.compile(PARTIAL_PATH_PATTERN) -# path is multiple link_name chunks, +# path is multiple link_id chunks, # each separated by a trailing / # (at least 1) -# followed by a single link_name with no trailing / -PATH_LINKNAME_ARGS_PATTERN = ( +# followed by a single link_id with no trailing / +PATH_LINK_ID_ARGS_PATTERN = ( r'%(partial_path)s/' - '(?P%(link_name)s)' % { + '(?P%(link_id)s)' % { 'partial_path' : PARTIAL_PATH_ARG_PATTERN, - 'link_name': LINKNAME_PATTERN_CORE}) -PATH_LINKNAME_PATTERN = r'^%s$' % PATH_LINKNAME_ARGS_PATTERN -PATH_LINKNAME_REGEX = re.compile(PATH_LINKNAME_PATTERN) + 'link_id': LINK_ID_PATTERN_CORE}) +PATH_LINK_ID_PATTERN = r'^%s$' % PATH_LINK_ID_ARGS_PATTERN +PATH_LINK_ID_REGEX = re.compile(PATH_LINK_ID_PATTERN) def getPartsFromPath(path): - """Splits path string into partial_path and link_name. + """Splits path string into partial_path and link_id. Returns: {'partial_path': 'everything/but', - 'link_name': 'link_name'} - or {} (empty dict) if string did not match PATH_LINKNAME_PATTERN. + 'link_id': 'link_id'} + or {} (empty dict) if string did not match PATH_LINK_ID_PATTERN. """ - path_link_name_match = PATH_LINKNAME_REGEX.match(path) + path_link_name_match = PATH_LINK_ID_REGEX.match(path) if not path_link_name_match: return {} @@ -83,7 +83,7 @@ the list is itself a list); for example: 'a/complete/path/in/one/string' ['some', 'path', 'parts'] - [['path', 'parts', 'and', 'a'], 'link name'] + [['path', 'parts', 'and', 'a'], 'link ID'] Returns: None if path_parts is False (None, empty string, etc.) or if diff -r 52557918ec8f -r aae25d2b4464 app/soc/logic/site/map.py --- a/app/soc/logic/site/map.py Thu Nov 20 18:06:43 2008 +0000 +++ b/app/soc/logic/site/map.py Thu Nov 20 18:50:30 2008 +0000 @@ -129,7 +129,7 @@ home_settings_edit = page.Page( page.Url( - r'^home/edit/%s$' % path_link_name.PATH_LINKNAME_ARGS_PATTERN, + r'^home/edit/%s$' % path_link_name.PATH_LINK_ID_ARGS_PATTERN, 'soc.views.models.home_settings.edit'), 'Site: Settings', short_name='Edit Site Settings', @@ -137,7 +137,7 @@ home_settings_show = page.Page( page.Url( - r'^home/show/%s$' % path_link_name.PATH_LINKNAME_ARGS_PATTERN, + r'^home/show/%s$' % path_link_name.PATH_LINK_ID_ARGS_PATTERN, 'soc.views.models.home_settings.public'), 'Show Document', parent=home) @@ -175,7 +175,7 @@ site_settings_edit = page.Page( page.Url( - r'^site/edit/%s$' % path_link_name.PATH_LINKNAME_ARGS_PATTERN, + r'^site/edit/%s$' % path_link_name.PATH_LINK_ID_ARGS_PATTERN, 'soc.views.models.site_settings.edit'), 'Site: Settings', short_name='Edit Site Settings', @@ -183,14 +183,14 @@ site_settings_show = page.Page( page.Url( - r'^site/show/%s$' % path_link_name.PATH_LINKNAME_ARGS_PATTERN, + r'^site/show/%s$' % path_link_name.PATH_LINK_ID_ARGS_PATTERN, 'soc.views.models.site_settings.public'), 'Show Site Settings', parent=home) site_settings_delete = page.Page( page.Url( - r'^site/delete/%s$' % path_link_name.PATH_LINKNAME_ARGS_PATTERN, + r'^site/delete/%s$' % path_link_name.PATH_LINK_ID_ARGS_PATTERN, 'soc.views.models.site_settings.delete'), 'Delete Site Settings', parent=home) @@ -221,7 +221,7 @@ site_user_edit = page.Page( page.Url( - r'^user/edit/%s$' % path_link_name.LINKNAME_ARG_PATTERN, + r'^user/edit/%s$' % path_link_name.LINK_ID_ARG_PATTERN, 'soc.views.models.user.edit'), 'Site: Modify Existing User Profile', short_name='Modify Site User', @@ -229,7 +229,7 @@ user_show = page.Page( page.Url( - r'^user/show/%s$' % path_link_name.LINKNAME_ARG_PATTERN, + r'^user/show/%s$' % path_link_name.LINK_ID_ARG_PATTERN, 'soc.views.models.user.public'), 'User: Show Existing User Profile', parent=user_signout) @@ -244,7 +244,7 @@ user_delete = page.Page( page.Url( - r'^user/delete/%s$' % path_link_name.LINKNAME_ARG_PATTERN, + r'^user/delete/%s$' % path_link_name.LINK_ID_ARG_PATTERN, 'soc.views.models.user.delete'), 'Site: Delete Existing User', short_name='Delete Site User', @@ -254,7 +254,7 @@ # Document views document_show = page.Page( page.Url( - r'^document/show/%s$' % path_link_name.PATH_LINKNAME_ARGS_PATTERN, + r'^document/show/%s$' % path_link_name.PATH_LINK_ID_ARGS_PATTERN, 'soc.views.models.document.public'), 'Show Document', parent=home) @@ -276,7 +276,7 @@ site_document_edit = page.Page( page.Url( - r'^document/edit/%s$' % path_link_name.PATH_LINKNAME_ARGS_PATTERN, + r'^document/edit/%s$' % path_link_name.PATH_LINK_ID_ARGS_PATTERN, 'soc.views.models.document.edit'), 'Site: Modify Existing Document', short_name='Modify Site Document', @@ -284,7 +284,7 @@ site_document_delete = page.Page( page.Url( - r'^document/delete/%s$' % path_link_name.PATH_LINKNAME_ARGS_PATTERN, + r'^document/delete/%s$' % path_link_name.PATH_LINK_ID_ARGS_PATTERN, 'soc.views.models.document.delete'), 'Site: Delete Existing Document', short_name='Delete Site Document', @@ -301,7 +301,7 @@ # Sponsor Group public view sponsor_profile = page.Page( page.Url( - r'^sponsor/show/%s$' % path_link_name.LINKNAME_ARG_PATTERN, + r'^sponsor/show/%s$' % path_link_name.LINK_ID_ARG_PATTERN, 'soc.views.models.sponsor.public'), 'Sponsor Public Profile', parent=home) @@ -323,7 +323,7 @@ site_sponsor_delete = page.Page( page.Url( - r'^sponsor/delete/%s$' % path_link_name.LINKNAME_ARG_PATTERN, + r'^sponsor/delete/%s$' % path_link_name.LINK_ID_ARG_PATTERN, 'soc.views.models.sponsor.delete'), 'Site: Delete Existing Sponsor', short_name='Delete Site Sponsor', @@ -331,7 +331,7 @@ site_sponsor_edit = page.Page( page.Url( - r'^sponsor/edit/%s$' % path_link_name.LINKNAME_ARG_PATTERN, + r'^sponsor/edit/%s$' % path_link_name.LINK_ID_ARG_PATTERN, 'soc.views.models.sponsor.edit'), 'Site: Modify Existing Sponsor', short_name='Modify Site Sponsor', @@ -349,7 +349,7 @@ host_profile = page.Page( page.Url( r'^host/show/(?P%(lnp)s)/(?P%(lnp)s)$' % { - 'lnp': path_link_name.LINKNAME_PATTERN_CORE}, + 'lnp': path_link_name.LINK_ID_PATTERN_CORE}, 'soc.views.models.host.public'), 'Host Public Profile', parent=home) @@ -372,7 +372,7 @@ site_host_delete = page.Page( page.Url( r'^host/delete/(?P%(lnp)s)/(?P%(lnp)s)$' % { - 'lnp': path_link_name.LINKNAME_PATTERN_CORE}, + 'lnp': path_link_name.LINK_ID_PATTERN_CORE}, 'soc.views.models.host.delete'), 'Site: Delete Existing Host', short_name='Delete Site Host', @@ -381,7 +381,7 @@ site_host_edit = page.Page( page.Url( r'^host/edit/(?P%(lnp)s)/(?P%(lnp)s)$' % { - 'lnp': path_link_name.LINKNAME_PATTERN_CORE}, + 'lnp': path_link_name.LINK_ID_PATTERN_CORE}, 'soc.views.models.host.edit'), 'Site: Modify Existing Host', short_name='Modify Site Host', @@ -396,10 +396,10 @@ parent=site_host_sub_menu) # these are not really used... -# (r'^org/profile/(?Pghop[_0-9a-z]+)/(?P[_0-9a-z]+)/$', +# (r'^org/profile/(?Pghop[_0-9a-z]+)/(?P[_0-9a-z]+)/$', # 'soc.views.person.profile.edit', # {'template': 'ghop/person/profile/edit.html'}), -# (r'^org/profile/(?P[_0-9a-z]+)/(?P[_0-9a-z]+)/$', +# (r'^org/profile/(?P[_0-9a-z]+)/(?P[_0-9a-z]+)/$', # 'soc.views.person.profile.edit'), diff -r 52557918ec8f -r aae25d2b4464 app/soc/logic/validate.py --- a/app/soc/logic/validate.py Thu Nov 20 18:06:43 2008 +0000 +++ b/app/soc/logic/validate.py Thu Nov 20 18:50:30 2008 +0000 @@ -45,13 +45,13 @@ return False -def isLinkNameFormatValid(link_name): - """Returns True if link_name is in a valid format. +def isLinkIdFormatValid(link_id): + """Returns True if link_id is in a valid format. Args: - link_name: link name used in URLs for identification + link_id: link ID used in URLs for identification """ - if path_link_name.LINKNAME_REGEX.match(link_name): + if path_link_name.LINK_ID_REGEX.match(link_id): return True return False @@ -60,7 +60,7 @@ """Returns True if partial_path is in a valid format. Args: - partial_path: partial path prepended to link name + partial_path: partial path prepended to link ID used for identification. """ diff -r 52557918ec8f -r aae25d2b4464 app/soc/models/answer.py --- a/app/soc/models/answer.py Thu Nov 20 18:06:43 2008 +0000 +++ b/app/soc/models/answer.py Thu Nov 20 18:50:30 2008 +0000 @@ -80,7 +80,7 @@ #: contain a single string that is a free-form text answer. #: #: For Questions that *are* multiple-choice, this list will contain one - #: or more short, plain-text, "link_name-like" strings representing the + #: or more short, plain-text, "link_id-like" strings representing the #: "encoded" answer choices (see the choice_ids property in #: soc.models.question.Question). For such multiple-choice Questions, #: how many strings are stored depends on the max_answers property of diff -r 52557918ec8f -r aae25d2b4464 app/soc/models/group.py --- a/app/soc/models/group.py Thu Nov 20 18:06:43 2008 +0000 +++ b/app/soc/models/group.py Thu Nov 20 18:50:30 2008 +0000 @@ -42,11 +42,11 @@ verbose_name=ugettext_lazy('Name')) name.help_text = ugettext_lazy('Complete, formal name of the group.') - #: Required field storing link_name used in URLs to identify group. + #: Required field storing link_id used in URLs to identify group. #: Lower ASCII characters only. - link_name = db.StringProperty(required=True, - verbose_name=ugettext_lazy('Link name')) - link_name.help_text = ugettext_lazy( + link_id = db.StringProperty(required=True, + verbose_name=ugettext_lazy('Link ID')) + link_id.help_text = ugettext_lazy( 'Field used in URLs to identify group. ' 'Lower ASCII characters only.') diff -r 52557918ec8f -r aae25d2b4464 app/soc/models/home_settings.py --- a/app/soc/models/home_settings.py Thu Nov 20 18:06:43 2008 +0000 +++ b/app/soc/models/home_settings.py Thu Nov 20 18:50:30 2008 +0000 @@ -52,13 +52,13 @@ 'The URL should be a valid ATOM or RSS feed. ' 'Feed entries are shown on the home page.') - #: Required path, prepended to a "link name" to form the Setting URL. + #: Required path, prepended to a "link ID" to form the Setting URL. partial_path = db.StringProperty(required=True, verbose_name=ugettext_lazy('Settings partial path')) partial_path.help_text = ugettext_lazy( - 'path portion of URLs for Settings, prepended to link name') + 'path portion of URLs for Settings, prepended to link ID') - #: Required link name, appended to a "path" to form the Setting URL. - link_name = db.StringProperty(required=True, - verbose_name=ugettext_lazy('Setttings link name')) - link_name.help_text = ugettext_lazy('link name for Settings used in URLs') + #: Required link ID, appended to a "path" to form the Setting URL. + link_id = db.StringProperty(required=True, + verbose_name=ugettext_lazy('Setttings link ID')) + link_id.help_text = ugettext_lazy('link ID for Settings used in URLs') diff -r 52557918ec8f -r aae25d2b4464 app/soc/models/question.py --- a/app/soc/models/question.py Thu Nov 20 18:06:43 2008 +0000 +++ b/app/soc/models/question.py Thu Nov 20 18:50:30 2008 +0000 @@ -45,10 +45,10 @@ on during creation or annotated once put into use). work.partial_path: used to scope (and, when combined with - work.link_name, uniquely identify) a Question in the same way the + work.link_id, uniquely identify) a Question in the same way the property are used with Documents, etc. - work.link_name: used to identify (and, when combined with + work.link_id: used to identify (and, when combined with work.partial_path, *uniquely* identify) a Question in the same way these properties are used with Documents, etc. @@ -87,18 +87,18 @@ are here now so that the concepts will not be lost before that time. The recommended use for the combination of work.partial_path and - work.link_name is to keep the *same* link_name when copying and + work.link_id is to keep the *same* link_id when copying and modifying an existing Question for a new Program (or instance of a Group that is per-Program), while changing the work.partial_path to represent the Program and Group "ownership" of the Question. For example, if a Question asking about prior GSoC participation needed to have an additional choice (see the choice_ids and choices properties - below), it is desirable to keep the same work.link_name (and also + below), it is desirable to keep the same work.link_id (and also simply append new choice_ids and choices to keep the old answer values compatible). An existing Question in the above example might be identified as something like: Question:google/gsoc2009/gsoc_past_participation - :// + :// To make it possible to query for gsoc_past_participation answers regardless of the Program, the next year, new values are added to choice_ids and choices in a new Question copied from the one above, which would then @@ -114,7 +114,7 @@ combination with GSoC, the gsoc_past_participation Question would be duplicated (unaltered) to something like: Question:google/ghop2009/gsoc_past_participation - To get the combined results, query on a link_name of + To get the combined results, query on a link_id of gsoc_past_participation. For more targeted results, include the partial_path to make the query more specific. @@ -126,7 +126,7 @@ A dynamic form is most definitely going to be needed to implement the Question creation and editing for multiple-choice questions. """ - #: db.ListProperty of short, plain-text, "link_name-like" strings + #: db.ListProperty of short, plain-text, "link_id-like" strings #: representing the "encoded" answer choices (must be strings compatible #: with being query arguments and being used in HTML controls and POST #: responses). diff -r 52557918ec8f -r aae25d2b4464 app/soc/models/quiz.py --- a/app/soc/models/quiz.py Thu Nov 20 18:06:43 2008 +0000 +++ b/app/soc/models/quiz.py Thu Nov 20 18:50:30 2008 +0000 @@ -52,7 +52,7 @@ work.reviews: even Quizzes can be "reviewed" (possibly commented on during creation or annotated once put into use). - work.partial_path/work.link_name: used to scope and uniquely identify + work.partial_path/work.link_id: used to scope and uniquely identify a Quiz in the same way these properties are used with Documents, etc. work.content: the "preface" of the Quiz, displayed before any diff -r 52557918ec8f -r aae25d2b4464 app/soc/models/user.py --- a/app/soc/models/user.py Thu Nov 20 18:06:43 2008 +0000 +++ b/app/soc/models/user.py Thu Nov 20 18:50:30 2008 +0000 @@ -79,11 +79,11 @@ nick_name = db.StringProperty(required=True, verbose_name=ugettext_lazy('Nick name')) - #: Required field storing link_name used in URLs to identify user. + #: Required field storing link_id used in URLs to identify user. #: Lower ASCII characters only. - link_name = db.StringProperty(required=True, - verbose_name=ugettext_lazy('Link name')) - link_name.help_text = ugettext_lazy( + link_id = db.StringProperty(required=True, + verbose_name=ugettext_lazy('Link ID')) + link_id.help_text = ugettext_lazy( 'Field used in URLs to identify user. ' 'Lower ASCII characters only.') diff -r 52557918ec8f -r aae25d2b4464 app/soc/models/work.py --- a/app/soc/models/work.py Thu Nov 20 18:06:43 2008 +0000 +++ b/app/soc/models/work.py Thu Nov 20 18:50:30 2008 +0000 @@ -57,23 +57,23 @@ title.help_text = ugettext_lazy( 'title of the document; often used in the window title') - #: Required path, prepended to a "link name" to form the document URL. - #: The combined path and link name must be globally unique on the + #: Required path, prepended to a "link ID" to form the document URL. + #: The combined path and link ID must be globally unique on the #: site. Except in /site/document (Developer) forms, this field is not #: usually directly editable by the User, but is instead set by controller #: logic to match the "scope" of the document. partial_path = db.StringProperty(required=True, verbose_name=ugettext_lazy('Partial path')) partial_path.help_text = ugettext_lazy( - 'path portion of URLs, prepended to link name') + 'path portion of URLs, prepended to link ID') - #: Required link name, appended to a "path" to form the document URL. - #: The combined path and link name must be globally unique on the - #: site (but, unlike some link names, a Work link name can be reused, + #: Required link ID, appended to a "path" to form the document URL. + #: The combined path and link ID must be globally unique on the + #: site (but, unlike some link IDs, a Work link ID can be reused, #: as long as the combination with the preceding path is unique). - link_name = db.StringProperty(required=True, - verbose_name=ugettext_lazy('Link name')) - link_name.help_text = ugettext_lazy('link name used in URLs') + link_id = db.StringProperty(required=True, + verbose_name=ugettext_lazy('Link ID')) + link_id.help_text = ugettext_lazy('link ID used in URLs') #: short name used in places such as the sidebar menu and breadcrumb trail #: (optional: title will be used if short_name is not present) diff -r 52557918ec8f -r aae25d2b4464 app/soc/templates/soc/document/list/docs_row.html --- a/app/soc/templates/soc/document/list/docs_row.html Thu Nov 20 18:06:43 2008 +0000 +++ b/app/soc/templates/soc/document/list/docs_row.html Thu Nov 20 18:50:30 2008 +0000 @@ -1,15 +1,15 @@ +onclick="document.location.href='/document/edit/{{ data_element.partial_path }}/{{ data_element.link_id }}'" name="name">
{{ data_element.partial_path}}/{{ data_element.link_name }} + href="/document/edit/{{ data_element.partial_path }}/{{ data_element.link_id }}">{{ data_element.partial_path}}/{{ data_element.link_id }}
{{ data_element.title }}
- + -
{{ data_element.author.link_name }}
+
{{ data_element.author.link_id }}
{{ data_element.created }}
{{ data_element.modified }}
diff -r 52557918ec8f -r aae25d2b4464 app/soc/templates/soc/group/list/group_heading.html --- a/app/soc/templates/soc/group/list/group_heading.html Thu Nov 20 18:06:43 2008 +0000 +++ b/app/soc/templates/soc/group/list/group_heading.html Thu Nov 20 18:50:30 2008 +0000 @@ -1,5 +1,5 @@ Name - Link name + Link ID Short name diff -r 52557918ec8f -r aae25d2b4464 app/soc/templates/soc/group/list/group_row.html --- a/app/soc/templates/soc/group/list/group_row.html Thu Nov 20 18:06:43 2008 +0000 +++ b/app/soc/templates/soc/group/list/group_row.html Thu Nov 20 18:50:30 2008 +0000 @@ -1,9 +1,9 @@ +onclick="document.location.href='/{{ entity_type|lower }}/edit/{{ data_element.link_id }}'" name="name">
{{ data_element.name }} + href="/{{ entity_type|lower }}/edit/{{ data_element.link_id }}">{{ data_element.name }}
- +
{{ data_element.short_name }}
diff -r 52557918ec8f -r aae25d2b4464 app/soc/templates/soc/home_settings/list/home_row.html --- a/app/soc/templates/soc/home_settings/list/home_row.html Thu Nov 20 18:06:43 2008 +0000 +++ b/app/soc/templates/soc/home_settings/list/home_row.html Thu Nov 20 18:50:30 2008 +0000 @@ -1,10 +1,10 @@ +onclick="document.location.href='/home/settings/edit/{{ data_element.partial_path }}/{{ data_element.link_id }}'" name="name">
{{ data_element.partial_path}}/{{ data_element.link_name }} + href="/home/settings/edit/{{ data_element.partial_path }}/{{ data_element.link_id }}">{{ data_element.partial_path}}/{{ data_element.link_id }}
- + diff -r 52557918ec8f -r aae25d2b4464 app/soc/templates/soc/host/list/host_heading.html --- a/app/soc/templates/soc/host/list/host_heading.html Thu Nov 20 18:06:43 2008 +0000 +++ b/app/soc/templates/soc/host/list/host_heading.html Thu Nov 20 18:50:30 2008 +0000 @@ -1,5 +1,5 @@ - User link name + User link ID Sponsor name Given name Surname diff -r 52557918ec8f -r aae25d2b4464 app/soc/templates/soc/host/list/host_row.html --- a/app/soc/templates/soc/host/list/host_row.html Thu Nov 20 18:06:43 2008 +0000 +++ b/app/soc/templates/soc/host/list/host_row.html Thu Nov 20 18:50:30 2008 +0000 @@ -1,7 +1,7 @@ -