# HG changeset patch # User Todd Larsen # Date 1227210211 0 # Node ID 3c1e16637ad7a4b5e6662fa421a53632ceee08bb # Parent aae25d2b44647caa4d64747e60228d9b7dedf5c0 Rename partial_path to scope_path, ignoring case, etc. (Similar to the recent link_name => link_id change). Also, fix two missed "Linkname" column headers in some templates. Patch by: Todd Larsen diff -r aae25d2b4464 -r 3c1e16637ad7 app/soc/logic/models/document.py --- a/app/soc/logic/models/document.py Thu Nov 20 18:50:30 2008 +0000 +++ b/app/soc/logic/models/document.py Thu Nov 20 19:43:31 2008 +0000 @@ -43,19 +43,19 @@ """See base.Logic.getKeyNameValues. """ - return [entity.partial_path, entity.link_id] + return [entity.scope_path, entity.link_id] def getKeyValuesFromFields(self, fields): """See base.Logic.getKeyValuesFromFields. """ - return [fields['partial_path'], fields['link_id']] + return [fields['scope_path'], fields['link_id']] def getKeyFieldNames(self): """See base.Logic.getKeyFieldNames. """ - return ['partial_path', 'link_id'] + return ['scope_path', 'link_id'] logic = Logic() diff -r aae25d2b4464 -r 3c1e16637ad7 app/soc/logic/models/home_settings.py --- a/app/soc/logic/models/home_settings.py Thu Nov 20 18:50:30 2008 +0000 +++ b/app/soc/logic/models/home_settings.py Thu Nov 20 19:43:31 2008 +0000 @@ -42,18 +42,18 @@ """See base.Logic.getKeyNameValues. """ - return [entity.partial_path, entity.link_id] + return [entity.scope_path, entity.link_id] def getKeyValuesFromFields(self, fields): """See base.Logic.getKeyValuesFromFields. """ - return [fields['partial_path'], fields['link_id']] + return [fields['scope_path'], fields['link_id']] def getKeyFieldNames(self): """See base.Logic.getKeyFieldNames. """ - return ['partial_path', 'link_id'] + return ['scope_path', 'link_id'] logic = Logic() diff -r aae25d2b4464 -r 3c1e16637ad7 app/soc/logic/models/site_settings.py --- a/app/soc/logic/models/site_settings.py Thu Nov 20 18:50:30 2008 +0000 +++ b/app/soc/logic/models/site_settings.py Thu Nov 20 19:43:31 2008 +0000 @@ -34,7 +34,7 @@ """Logic methods for the SiteSettings model. """ - DEF_SITE_SETTINGS_PARTIAL_PATH = 'site' + DEF_SITE_SETTINGS_SCOPE_PATH = 'site' DEF_SITE_SETTINGS_LINK_ID = 'home' DEF_SITE_HOME_DOC_LINK_ID = 'home' @@ -48,7 +48,7 @@ """Returns the default key values for the site settings. """ - return [self.DEF_SITE_SETTINGS_PARTIAL_PATH, + return [self.DEF_SITE_SETTINGS_SCOPE_PATH, self.DEF_SITE_SETTINGS_LINK_ID] diff -r aae25d2b4464 -r 3c1e16637ad7 app/soc/logic/path_link_name.py --- a/app/soc/logic/path_link_name.py Thu Nov 20 18:50:30 2008 +0000 +++ b/app/soc/logic/path_link_name.py Thu Nov 20 19:43:31 2008 +0000 @@ -36,33 +36,33 @@ LINK_ID_PATTERN = r'^%s$' % LINK_ID_PATTERN_CORE LINK_ID_REGEX = re.compile(LINK_ID_PATTERN) -# partial path is multiple link_id chunks, +# scope path is multiple link_id chunks, # each separated by a trailing / # (at least 1) -PARTIAL_PATH_ARG_PATTERN = (r'(?P%(link_id)s' +SCOPE_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) +SCOPE_PATH_PATTERN = r'^%s$' % SCOPE_PATH_ARG_PATTERN +SCOPE_PATH_REGEX = re.compile(SCOPE_PATH_PATTERN) # path is multiple link_id chunks, # each separated by a trailing / # (at least 1) # followed by a single link_id with no trailing / PATH_LINK_ID_ARGS_PATTERN = ( - r'%(partial_path)s/' + r'%(scope_path)s/' '(?P%(link_id)s)' % { - 'partial_path' : PARTIAL_PATH_ARG_PATTERN, + 'scope_path' : SCOPE_PATH_ARG_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_id. + """Splits path string into scope_path and link_id. Returns: - {'partial_path': 'everything/but', + {'scope_path': 'everything/but', 'link_id': 'link_id'} or {} (empty dict) if string did not match PATH_LINK_ID_PATTERN. """ diff -r aae25d2b4464 -r 3c1e16637ad7 app/soc/logic/validate.py --- a/app/soc/logic/validate.py Thu Nov 20 18:50:30 2008 +0000 +++ b/app/soc/logic/validate.py Thu Nov 20 19:43:31 2008 +0000 @@ -56,15 +56,15 @@ return False -def isPartialPathFormatValid(partial_path): - """Returns True if partial_path is in a valid format. +def isScopePathFormatValid(scope_path): + """Returns True if scope_path is in a valid format. Args: - partial_path: partial path prepended to link ID + scope_path: scope path prepended to link ID used for identification. """ - if path_link_name.PARTIAL_PATH_REGEX.match(partial_path): + if path_link_name.SCOPE_PATH_REGEX.match(scope_path): return True return False diff -r aae25d2b4464 -r 3c1e16637ad7 app/soc/models/home_settings.py --- a/app/soc/models/home_settings.py Thu Nov 20 18:50:30 2008 +0000 +++ b/app/soc/models/home_settings.py Thu Nov 20 19:43:31 2008 +0000 @@ -53,9 +53,9 @@ 'Feed entries are shown on the home page.') #: 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( + scope_path = db.StringProperty(required=True, + verbose_name=ugettext_lazy('Settings scope path')) + scope_path.help_text = ugettext_lazy( 'path portion of URLs for Settings, prepended to link ID') #: Required link ID, appended to a "path" to form the Setting URL. diff -r aae25d2b4464 -r 3c1e16637ad7 app/soc/models/question.py --- a/app/soc/models/question.py Thu Nov 20 18:50:30 2008 +0000 +++ b/app/soc/models/question.py Thu Nov 20 19:43:31 2008 +0000 @@ -44,12 +44,12 @@ work.reviews: even Questions can be "reviewed" (possibly commented on during creation or annotated once put into use). - work.partial_path: used to scope (and, when combined with + work.scope_path: used to scope (and, when combined with work.link_id, uniquely identify) a Question in the same way the property are used with Documents, etc. work.link_id: used to identify (and, when combined with - work.partial_path, *uniquely* identify) a Question in the same way + work.scope_path, *uniquely* identify) a Question in the same way these properties are used with Documents, etc. work.content: the Question text, asked to the respondent @@ -86,10 +86,10 @@ when these ideas are implemented in the views and controllers; they 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 + The recommended use for the combination of work.scope_path 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 + Group that is per-Program), while changing the work.scope_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 @@ -116,7 +116,7 @@ Question:google/ghop2009/gsoc_past_participation 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. + scope_path to make the query more specific. Question creation to permit use cases like the one above is going to be a bit of an "advanced" skill, possibly. "Doing it wrong" the first diff -r aae25d2b4464 -r 3c1e16637ad7 app/soc/models/quiz.py --- a/app/soc/models/quiz.py Thu Nov 20 18:50:30 2008 +0000 +++ b/app/soc/models/quiz.py Thu Nov 20 19:43:31 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_id: used to scope and uniquely identify + work.scope_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 aae25d2b4464 -r 3c1e16637ad7 app/soc/models/work.py --- a/app/soc/models/work.py Thu Nov 20 18:50:30 2008 +0000 +++ b/app/soc/models/work.py Thu Nov 20 19:43:31 2008 +0000 @@ -62,9 +62,9 @@ #: 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( + scope_path = db.StringProperty(required=True, + verbose_name=ugettext_lazy('Scope path')) + scope_path.help_text = ugettext_lazy( 'path portion of URLs, prepended to link ID') #: Required link ID, appended to a "path" to form the document URL. diff -r aae25d2b4464 -r 3c1e16637ad7 app/soc/templates/soc/document/list/docs_heading.html --- a/app/soc/templates/soc/document/list/docs_heading.html Thu Nov 20 18:50:30 2008 +0000 +++ b/app/soc/templates/soc/document/list/docs_heading.html Thu Nov 20 19:43:31 2008 +0000 @@ -1,7 +1,7 @@ Path Title - Linkname + Link ID Featured Created By Created On diff -r aae25d2b4464 -r 3c1e16637ad7 app/soc/templates/soc/document/list/docs_row.html --- a/app/soc/templates/soc/document/list/docs_row.html Thu Nov 20 18:50:30 2008 +0000 +++ b/app/soc/templates/soc/document/list/docs_row.html Thu Nov 20 19:43:31 2008 +0000 @@ -1,9 +1,9 @@ +onclick="document.location.href='/document/edit/{{ data_element.scope_path }}/{{ data_element.link_id }}'" name="name">
{{ data_element.partial_path}}/{{ data_element.link_id }} + href="/document/edit/{{ data_element.scope_path }}/{{ data_element.link_id }}">{{ data_element.scope_path}}/{{ data_element.link_id }}
{{ data_element.title }}
diff -r aae25d2b4464 -r 3c1e16637ad7 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:50:30 2008 +0000 +++ b/app/soc/templates/soc/home_settings/list/home_row.html Thu Nov 20 19:43:31 2008 +0000 @@ -1,9 +1,9 @@ +onclick="document.location.href='/home/settings/edit/{{ data_element.scope_path }}/{{ data_element.link_id }}'" name="name">
{{ data_element.partial_path}}/{{ data_element.link_id }} + href="/home/settings/edit/{{ data_element.scope_path }}/{{ data_element.link_id }}">{{ data_element.scope_path}}/{{ data_element.link_id }}
diff -r aae25d2b4464 -r 3c1e16637ad7 app/soc/templates/soc/site_settings/edit.html --- a/app/soc/templates/soc/site_settings/edit.html Thu Nov 20 18:50:30 2008 +0000 +++ b/app/soc/templates/soc/site_settings/edit.html Thu Nov 20 19:43:31 2008 +0000 @@ -49,7 +49,7 @@ Path: - {{ home_doc.partial_path }}/{{ home_doc.link_id }} + {{ home_doc.scope_path }}/{{ home_doc.link_id }} diff -r aae25d2b4464 -r 3c1e16637ad7 app/soc/templates/soc/site_settings/list/site_row.html --- a/app/soc/templates/soc/site_settings/list/site_row.html Thu Nov 20 18:50:30 2008 +0000 +++ b/app/soc/templates/soc/site_settings/list/site_row.html Thu Nov 20 19:43:31 2008 +0000 @@ -1,9 +1,9 @@ +onclick="document.location.href='/site/settings/edit/{{ data_element.scope_path }}/{{ data_element.link_id }}'" name="name">
{{ data_element.partial_path}}/{{ data_element.link_id }} + href="/site/settings/edit/{{ data_element.scope_path }}/{{ data_element.link_id }}">{{ data_element.scope_path}}/{{ data_element.link_id }}
diff -r aae25d2b4464 -r 3c1e16637ad7 app/soc/templates/soc/user/list/user_heading.html --- a/app/soc/templates/soc/user/list/user_heading.html Thu Nov 20 18:50:30 2008 +0000 +++ b/app/soc/templates/soc/user/list/user_heading.html Thu Nov 20 19:43:31 2008 +0000 @@ -2,5 +2,5 @@ Account Email Nickname - Linkname + Link ID diff -r aae25d2b4464 -r 3c1e16637ad7 app/soc/views/document/edit.py --- a/app/soc/views/document/edit.py Thu Nov 20 18:50:30 2008 +0000 +++ b/app/soc/views/document/edit.py Thu Nov 20 19:43:31 2008 +0000 @@ -62,11 +62,11 @@ user = users.get_current_user() - partial_path = form.cleaned_data.get('partial_path') + scope_path = form.cleaned_data.get('scope_path') link_id = form.cleaned_data.get('link_id') properties = {} - properties['partial_path'] = partial_path + properties['scope_path'] = scope_path properties['link_id'] = link_id properties['title'] = form.cleaned_data.get('title') properties['short_name'] = form.cleaned_data.get('short_name') @@ -92,10 +92,10 @@ #: list of model fields which will *not* be gathered by the form exclude = ['inheritance_line', 'author', 'created', 'modified'] - def clean_partial_path(self): - partial_path = self.cleaned_data.get('partial_path') + def clean_scope_path(self): + scope_path = self.cleaned_data.get('scope_path') # TODO(tlarsen): combine path and link_id and check for uniqueness - return partial_path + return scope_path def clean_link_id(self): link_id = self.cleaned_data.get('link_id') @@ -140,7 +140,7 @@ if not doc: return http.HttpResponseRedirect('/') - new_path = path_link_name.combinePath([doc.partial_path, doc.link_id]) + new_path = path_link_name.combinePath([doc.scope_path, doc.link_id]) # redirect to new /document/edit/new_path?s=0 # (causes 'Profile saved' message to be displayed) @@ -167,14 +167,14 @@ @decorators.view -def edit(request, page_name=None, partial_path=None, link_id=None, +def edit(request, page_name=None, scope_path=None, link_id=None, template=DEF_DOCS_EDIT_TMPL): """View to modify the properties of a Document Model entity. Args: request: the standard django request object page_name: the page name displayed in templates as page and header title - partial_path: the Document's site-unique "path" extracted from the URL, + scope_path: the Document's site-unique "path" extracted from the URL, minus the trailing link_id link_id: the last portion of the Document's site-unique "path" extracted from the URL @@ -199,12 +199,12 @@ doc = None # assume that no Document entity will be found - path = path_link_name.combinePath([partial_path, link_id]) + path = path_link_name.combinePath([scope_path, link_id]) # try to fetch Document entity corresponding to path if one exists try: if path: - doc = document.logic.getFromFields(partial_path=partial_path, + doc = document.logic.getFromFields(scope_path=scope_path, link_id=link_id) except out_of_band.ErrorResponse, error: # show custom 404 page when path doesn't exist in Datastore @@ -220,7 +220,7 @@ if not doc: return http.HttpResponseRedirect('/') - new_path = path_link_name.combinePath([doc.partial_path, doc.link_id]) + new_path = path_link_name.combinePath([doc.scope_path, doc.link_id]) # redirect to new /document/edit/new_path?s=0 # (causes 'Profile saved' message to be displayed) @@ -248,7 +248,7 @@ # populate form with the existing Document entity author_link_id = doc.author.link_id form = EditForm(initial={'doc_key_name': doc.key().name(), - 'title': doc.title, 'partial_path': doc.partial_path, + 'title': doc.title, 'scope_path': doc.scope_path, 'link_id': doc.link_id, 'short_name': doc.short_name, 'content': doc.content, 'author': doc.author, 'is_featured': doc.is_featured, 'created_by': author_link_id}) @@ -275,14 +275,14 @@ @decorators.view -def delete(request, page_name=None, partial_path=None, link_id=None, +def delete(request, page_name=None, scope_path=None, link_id=None, template=DEF_DOCS_EDIT_TMPL): """Request handler to delete Document Model entity. Args: request: the standard django request object page_name: the page name displayed in templates as page and header title - partial_path: the Document's site-unique "path" extracted from the URL, + scope_path: the Document's site-unique "path" extracted from the URL, minus the trailing link_id link_id: the last portion of the Document's site-unique "path" extracted from the URL @@ -306,12 +306,12 @@ context['page_name'] = page_name existing_doc = None - path = path_link_name.combinePath([partial_path, link_id]) + path = path_link_name.combinePath([scope_path, link_id]) # try to fetch Document entity corresponding to path if one exists try: if path: - existing_doc = document.logic.getFromFields(partial_path=partial_path, + existing_doc = document.logic.getFromFields(scope_path=scope_path, link_id=link_id) except out_of_band.ErrorResponse, error: # show custom 404 page when path doesn't exist in Datastore diff -r aae25d2b4464 -r 3c1e16637ad7 app/soc/views/document/show.py --- a/app/soc/views/document/show.py Thu Nov 20 18:50:30 2008 +0000 +++ b/app/soc/views/document/show.py Thu Nov 20 19:43:31 2008 +0000 @@ -38,14 +38,14 @@ DEF_DOCS_PUBLIC_TMPL = 'soc/document/public.html' @decorators.view -def public(request, page_name=None, partial_path=None, link_id=None, +def public(request, page_name=None, scope_path=None, link_id=None, template=DEF_DOCS_PUBLIC_TMPL): """How the "general public" sees a Document. Args: request: the standard django request object page_name: the page name displayed in templates as page and header title - partial_path: the Document's site-unique "path" extracted from the URL, + scope_path: the Document's site-unique "path" extracted from the URL, minus the trailing link_id link_id: the last portion of the Document's site-unique "path" extracted from the URL @@ -69,12 +69,12 @@ doc = None # try to fetch User entity corresponding to link_id if one exists - path = path_link_name.combinePath([partial_path, link_id]) + path = path_link_name.combinePath([scope_path, link_id]) # try to fetch Document entity corresponding to path if one exists try: if path: - doc = document.logic.getFromFields(partial_path=partial_path, + doc = document.logic.getFromFields(scope_path=scope_path, link_id=link_id) except out_of_band.ErrorResponse, error: # show custom 404 page when Document path doesn't exist in Datastore diff -r aae25d2b4464 -r 3c1e16637ad7 app/soc/views/helper/responses.py --- a/app/soc/views/helper/responses.py Thu Nov 20 18:50:30 2008 +0000 +++ b/app/soc/views/helper/responses.py Thu Nov 20 19:43:31 2008 +0000 @@ -108,7 +108,7 @@ context['sidebar_menu_items'] = sidebar.SIDEBAR settings = site_settings.logic.getFromFields( - partial_path=site_settings.logic.DEF_SITE_SETTINGS_PARTIAL_PATH, + scope_path=site_settings.logic.DEF_SITE_SETTINGS_SCOPE_PATH, link_id=site_settings.logic.DEF_SITE_SETTINGS_LINK_ID) if settings: diff -r aae25d2b4464 -r 3c1e16637ad7 app/soc/views/home.py --- a/app/soc/views/home.py Thu Nov 20 18:50:30 2008 +0000 +++ b/app/soc/views/home.py Thu Nov 20 19:43:31 2008 +0000 @@ -39,7 +39,7 @@ DEF_HOME_PUBLIC_TMPL = 'soc/home/public.html' @decorators.view -def public(request, page_name=None, partial_path=None, link_id=None, +def public(request, page_name=None, scope_path=None, link_id=None, entity_type='HomeSettings', template=DEF_HOME_PUBLIC_TMPL): """How the "general public" sees a "home" page. @@ -58,7 +58,7 @@ context = helper.responses.getUniversalContext(request) settings = models.site_settings.logic.getFromFields( - partial_path=partial_path, link_id=link_id) + scope_path=scope_path, link_id=link_id) if settings: context['home_settings'] = settings diff -r aae25d2b4464 -r 3c1e16637ad7 app/soc/views/models/document.py --- a/app/soc/views/models/document.py Thu Nov 20 18:50:30 2008 +0000 +++ b/app/soc/views/models/document.py Thu Nov 20 19:43:31 2008 +0000 @@ -54,12 +54,12 @@ #: list of model fields which will *not* be gathered by the form exclude = ['inheritance_line', 'author', 'created', 'modified'] - def clean_partial_path(self): - partial_path = self.cleaned_data.get('partial_path') + def clean_scope_path(self): + scope_path = self.cleaned_data.get('scope_path') # TODO(tlarsen): combine path and link_id and check for uniqueness - if not validate.isPartialPathFormatValid(partial_path): - raise forms.ValidationError("This partial path is in wrong format.") - return partial_path + if not validate.isScopePathFormatValid(scope_path): + raise forms.ValidationError("This scope path is in wrong format.") + return scope_path def clean_link_id(self): link_id = self.cleaned_data.get('link_id') diff -r aae25d2b4464 -r 3c1e16637ad7 app/soc/views/models/home_settings.py --- a/app/soc/views/models/home_settings.py Thu Nov 20 18:50:30 2008 +0000 +++ b/app/soc/views/models/home_settings.py Thu Nov 20 19:43:31 2008 +0000 @@ -48,11 +48,11 @@ This form includes validation functions for Settings fields. """ - # TODO(tlarsen): partial_path will be a hard-coded read-only + # TODO(tlarsen): scope_path will be a hard-coded read-only # field for some (most?) User Roles - doc_partial_path = forms.CharField(required=False, - label=ugettext_lazy('Document partial path'), - help_text=soc.models.work.Work.partial_path.help_text) + doc_scope_path = forms.CharField(required=False, + label=ugettext_lazy('Document scope path'), + help_text=soc.models.work.Work.scope_path.help_text) # TODO(tlarsen): actually, using these two text fields to specify # the Document is pretty cheesy; this needs to be some much better @@ -166,7 +166,7 @@ try: if entity.home: - form.fields['doc_partial_path'].initial = entity.home.partial_path + form.fields['doc_scope_path'].initial = entity.home.scope_path form.fields['doc_link_id'].initial = entity.home.link_id except db.Error: pass @@ -175,12 +175,12 @@ """See base.View._editPost(). """ - doc_partial_path = fields['doc_partial_path'] + doc_scope_path = fields['doc_scope_path'] doc_link_id = fields['doc_link_id'] # TODO notify the user if home_doc is not found home_doc = document_logic.logic.getFromFields( - partial_path=doc_partial_path, link_id=doc_link_id) + scope_path=doc_scope_path, link_id=doc_link_id) fields['home'] = home_doc diff -r aae25d2b4464 -r 3c1e16637ad7 app/soc/views/models/site_settings.py --- a/app/soc/views/models/site_settings.py Thu Nov 20 18:50:30 2008 +0000 +++ b/app/soc/views/models/site_settings.py Thu Nov 20 19:43:31 2008 +0000 @@ -52,9 +52,9 @@ model = soc.models.site_settings.SiteSettings #: list of model fields which will *not* be gathered by the form - exclude = ['inheritance_line', 'home', 'partial_path', 'link_id'] + exclude = ['inheritance_line', 'home', 'scope_path', 'link_id'] - partial_path = forms.CharField(widget=forms.HiddenInput) + scope_path = forms.CharField(widget=forms.HiddenInput) link_id = forms.CharField(widget=forms.HiddenInput) diff -r aae25d2b4464 -r 3c1e16637ad7 app/soc/views/settings.py --- a/app/soc/views/settings.py Thu Nov 20 18:50:30 2008 +0000 +++ b/app/soc/views/settings.py Thu Nov 20 19:43:31 2008 +0000 @@ -85,11 +85,11 @@ """Django form displayed to select a Document. """ - # TODO(tlarsen): partial_path will be a hard-coded read-only + # TODO(tlarsen): scope_path will be a hard-coded read-only # field for some (most?) User Roles - doc_partial_path = forms.CharField(required=False, - label=soc.models.work.Work.partial_path.verbose_name, - help_text=soc.models.work.Work.partial_path.help_text) + doc_scope_path = forms.CharField(required=False, + label=soc.models.work.Work.scope_path.verbose_name, + help_text=soc.models.work.Work.scope_path.help_text) # TODO(tlarsen): actually, using these two text fields to specify # the Document is pretty cheesy; this needs to be some much better @@ -105,7 +105,7 @@ DEF_HOME_EDIT_TMPL = 'soc/site_settings/edit.html' @decorators.view -def edit(request, page_name=None, partial_path=None, link_id=None, +def edit(request, page_name=None, scope_path=None, link_id=None, logic=models.home_settings.logic, settings_form_class=SettingsForm, template=DEF_HOME_EDIT_TMPL): @@ -150,11 +150,11 @@ value = settings_form.cleaned_data.get(field) fields[field] = value - doc_partial_path = doc_select_form.cleaned_data.get('doc_partial_path') + doc_scope_path = doc_select_form.cleaned_data.get('doc_scope_path') doc_link_id = doc_select_form.cleaned_data.get('doc_link_id') home_doc = document.logic.getFromFields( - partial_path=doc_partial_path, link_id=doc_link_id) + scope_path=doc_scope_path, link_id=doc_link_id) if home_doc: fields['home'] = home_doc @@ -171,7 +171,7 @@ home_doc = settings.home else: # request.method == 'GET' # try to fetch HomeSettings entity by unique key_name - settings = logic.getFromFields(partial_path=partial_path, + settings = logic.getFromFields(scope_path=scope_path, link_id=link_id) if settings: @@ -186,7 +186,7 @@ if home_doc: doc_select_form = DocSelectForm(initial={ - 'doc_partial_path': home_doc.partial_path, + 'doc_scope_path': home_doc.scope_path, 'doc_link_id': home_doc.link_id}) else: doc_select_form = DocSelectForm() diff -r aae25d2b4464 -r 3c1e16637ad7 app/soc/views/site/settings.py --- a/app/soc/views/site/settings.py Thu Nov 20 18:50:30 2008 +0000 +++ b/app/soc/views/site/settings.py Thu Nov 20 19:43:31 2008 +0000 @@ -47,7 +47,7 @@ @decorators.view -def edit(request, page_name=None, partial_path=None, link_id=None, +def edit(request, page_name=None, scope_path=None, link_id=None, logic=models.site_settings.logic, settings_form_class=SiteSettingsForm, template=settings_views.DEF_HOME_EDIT_TMPL): @@ -64,7 +64,7 @@ Returns: A subclass of django.http.HttpResponse with generated template. """ - return settings_views.edit(request, page_name=page_name, partial_path=partial_path, + return settings_views.edit(request, page_name=page_name, scope_path=scope_path, link_id=link_id, logic=logic, settings_form_class=settings_form_class, template=template)