Skip to content

Commit

Permalink
MAINT: rename printRessort to print_ressort
Browse files Browse the repository at this point in the history
keep consistent naming for variables
  • Loading branch information
stollero committed Nov 15, 2024
1 parent 4cc7fcb commit 1e4d2b9
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions core/src/zeit/cms/browser/listing.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ def ressort(self):
return self.context.ressort

@zope.cachedescriptors.property.Lazy
def printRessort(self):
if self.context.printRessort:
return self.context.printRessort
def print_ressort(self):
if self.context.print_ressort:
return self.context.print_ressort
return self.context.ressort

@zope.cachedescriptors.property.Lazy
Expand Down
2 changes: 1 addition & 1 deletion core/src/zeit/cms/content/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class ICommonMetadata(zope.interface.Interface):
)
zope.interface.alsoProvides(channels.value_type, IChannelField)

printRessort = zope.schema.TextLine(title=_('Print ressort'), required=False)
print_ressort = zope.schema.TextLine(title=_('Print ressort'), required=False)

# not required since e.g. Agenturmeldungen don't have an author, only
# a copyright notice
Expand Down
4 changes: 2 additions & 2 deletions core/src/zeit/cms/content/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ class CommonMetadata(zeit.cms.content.xmlsupport.XMLContentBase):
'.teaser.supertitle', ICommonMetadata['teaserSupertitle']
)

printRessort = zeit.cms.content.dav.DAVProperty(
ICommonMetadata['printRessort'], zeit.cms.interfaces.PRINT_NAMESPACE, 'ressort'
print_ressort = zeit.cms.content.dav.DAVProperty(
ICommonMetadata['print_ressort'], zeit.cms.interfaces.PRINT_NAMESPACE, 'ressort'
)

commentsPremoderate = zeit.cms.content.dav.DAVProperty(
Expand Down
2 changes: 1 addition & 1 deletion core/src/zeit/content/article/edit/browser/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ class PrintFormGroup(zeit.edit.browser.form.FoldableFormGroup):
class PrintMetadata(zeit.edit.browser.form.InlineForm):
legend = _('')
prefix = 'print-metadata'
form_fields = FormFields(ICommonMetadata).select('year', 'volume', 'page', 'printRessort')
form_fields = FormFields(ICommonMetadata).select('year', 'volume', 'page', 'print_ressort')

def _success_handler(self):
self.signal('reload-inline-view', 'edit.heading')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ def test_form_should_save_entered_text_on_blur(self):
s.waitForElementNotPresent('css=.field.dirty')
s.type('id=print-metadata.year', '2010')
s.keyPress('id=print-metadata.volume', Keys.TAB)
s.type('id=print-metadata.printRessort', 'Politik')
s.keyPress('id=print-metadata.printRessort', Keys.TAB) # Trigger blur
s.type('id=print-metadata.print_ressort', 'Politik')
s.keyPress('id=print-metadata.print_ressort', Keys.TAB) # Trigger blur
s.waitForElementNotPresent('css=.field.dirty')
# Re-open the page and verify that the data is still there
s.clickAndWait('link=Edit contents')
s.waitForElementPresent('id=print-metadata.year')
s.assertValue('id=print-metadata.year', '2010')
s.waitForElementPresent('id=print-metadata.year')
s.assertValue('id=print-metadata.printRessort', 'Politik')
s.assertValue('id=print-metadata.print_ressort', 'Politik')

def test_form_should_save_selection_on_blur(self):
s = self.selenium
Expand Down Expand Up @@ -80,7 +80,7 @@ def test_invalid_input_should_display_error_message(self):
s.assertValue('id=print-metadata.year', '2007')
s.type('id=print-metadata.year', 'ASDF')
s.keyPress('id=print-metadata.volume', Keys.TAB)
s.keyPress('id=print-metadata.printRessort', Keys.TAB) # Trigger blur
s.keyPress('id=print-metadata.print_ressort', Keys.TAB) # Trigger blur
s.waitForElementPresent('css=.inline-form div.error')

def test_relateds_should_be_addable(self):
Expand Down
4 changes: 2 additions & 2 deletions core/src/zeit/content/cp/tests/test_automatic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1261,14 +1261,14 @@ def test_print_queries(self):
self.area.query = (
('year', 'eq', 2024),
('volume', 'eq', 10),
('printRessort', 'eq', 'DIE ZEIT'),
('print_ressort', 'eq', 'Politik'),
)
self.area.query_order = 'page'
IRenderedArea(self.area).values()
query = """
...properties.volume_year = '2024'
AND properties.volume_number = '10'
AND properties.print_ressort = 'DIE ZEIT'...
AND properties.print_ressort = 'Politik'...
ORDER BY page asc...
"""
self.assertEllipsis(query, self.connector.search_args[0])
2 changes: 1 addition & 1 deletion core/src/zeit/content/volume/browser/tests/test_toc.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def setUp(self):
article.title = self.article_title
article.subtitle = 'required'
article.page = self.article_page
article.printRessort = 'ressort %s' % ressort
article.print_ressort = 'ressort %s' % ressort
self.repository['2015']['01']['test_artikel_%s' % ressort] = article

def test_toc_view_is_csv_file_download(self):
Expand Down
2 changes: 1 addition & 1 deletion core/src/zeit/content/volume/browser/toc.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def _get_ir_content(self):
toc_entry['preview_url'] = zope.component.getMultiAdapter(
(article, 'preview'), IPreviewURL
)
result_for_product[article.printRessort].append(toc_entry)
result_for_product[article.print_ressort].append(toc_entry)
results[product.title] = result_for_product
return results

Expand Down
2 changes: 1 addition & 1 deletion core/src/zeit/content/volume/browser/toc_listing.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class TocListing(zeit.cms.browser.listing.Listing):
+ zeit.cms.browser.listing.Listing.columns[4:6]
+ (
zeit.cms.browser.listing.GetterColumn(
_('Ressort'), name='ressort', getter=lambda t, c: t.printRessort
_('Ressort'), name='ressort', getter=lambda t, c: t.print_ressort
),
)
+ (
Expand Down
4 changes: 2 additions & 2 deletions core/src/zeit/contentquery/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class QueryTypeSource(zeit.cms.content.sources.SimpleDictSource):
'content_type': _('query-type-content-type'),
'year': _('query-type-year'),
'volume': _('query-type-volume'),
'printRessort': _('query-type-printRessort'),
'print_ressort': _('query-type-print_ressort'),
}


Expand Down Expand Up @@ -191,7 +191,7 @@ class IQueryConditions(zeit.content.article.interfaces.IArticle):
content_type = zope.schema.Choice(
title=_('Content type'), source=zeit.cms.content.sources.CMSContentTypeSource()
)
printRessort = zope.schema.Choice(
print_ressort = zope.schema.Choice(
title=_('Print Ressort'), source=zeit.cms.content.sources.PrintRessortSource()
)

Expand Down

0 comments on commit 1e4d2b9

Please sign in to comment.