launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #19613
[Merge] lp:~cjwatson/launchpad/distribution-display-name into lp:launchpad
Colin Watson has proposed merging lp:~cjwatson/launchpad/distribution-display-name into lp:launchpad.
Commit message:
Rename {Distribution,DistroSeries,DistributionMirror}.displayname to display_name, leaving properties behind for compatibility.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/distribution-display-name/+merge/274252
Rename {Distribution,DistroSeries,DistributionMirror}.displayname to display_name, leaving properties behind for compatibility.
This follows https://code.launchpad.net/~cjwatson/launchpad/sourcepackage-display-name/+merge/274167.
--
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/distribution-display-name into lp:launchpad.
=== modified file 'lib/lp/bugs/vocabularies.py'
--- lib/lp/bugs/vocabularies.py 2015-07-08 16:05:11 +0000
+++ lib/lp/bugs/vocabularies.py 2015-10-13 13:37:18 +0000
@@ -19,8 +19,6 @@
'WebBugTrackerVocabulary',
]
-from operator import attrgetter
-
from sqlobject import (
CONTAINSSTRING,
OR,
@@ -214,7 +212,7 @@
class DistributionUsingMaloneVocabulary:
"""All the distributions that uses Malone officially."""
- _orderBy = 'displayname'
+ _orderBy = 'display_name'
def __init__(self, context=None):
self.context = context
=== modified file 'lib/lp/registry/browser/distribution.py'
--- lib/lp/registry/browser/distribution.py 2015-09-25 13:54:46 +0000
+++ lib/lp/registry/browser/distribution.py 2015-10-13 13:37:18 +0000
@@ -822,7 +822,7 @@
label = "Register a new distribution"
field_names = [
"name",
- "displayname",
+ "display_name",
"summary",
"description",
"domainname",
@@ -865,8 +865,8 @@
def save_action(self, action, data):
distribution = getUtility(IDistributionSet).new(
name=data['name'],
- displayname=data['displayname'],
- title=data['displayname'],
+ display_name=data['display_name'],
+ title=data['display_name'],
summary=data['summary'],
description=data['description'],
domainname=data['domainname'],
@@ -889,7 +889,7 @@
schema = IDistribution
field_names = [
- 'displayname',
+ 'display_name',
'summary',
'description',
'bug_reporting_guidelines',
=== modified file 'lib/lp/registry/browser/distributionmirror.py'
--- lib/lp/registry/browser/distributionmirror.py 2015-07-08 16:05:11 +0000
+++ lib/lp/registry/browser/distributionmirror.py 2015-10-13 13:37:18 +0000
@@ -196,9 +196,12 @@
@implementer(IDistributionMirrorMenuMarker)
class DistributionMirrorAddView(LaunchpadFormView):
schema = IDistributionMirror
- field_names = ["displayname", "description", "whiteboard", "http_base_url",
- "ftp_base_url", "rsync_base_url", "speed", "country",
- "content", "official_candidate"]
+ field_names = [
+ "display_name", "description", "whiteboard", "http_base_url",
+ "ftp_base_url", "rsync_base_url", "speed", "country", "content",
+ "official_candidate",
+ ]
+
@property
def label(self):
"""See `LaunchpadFormView`."""
@@ -218,7 +221,7 @@
def create_action(self, action, data):
mirror = self.context.newMirror(
owner=self.user, speed=data['speed'], country=data['country'],
- content=data['content'], displayname=data['displayname'],
+ content=data['content'], display_name=data['display_name'],
description=data['description'],
whiteboard=data['whiteboard'],
http_base_url=data['http_base_url'],
@@ -263,9 +266,12 @@
class DistributionMirrorEditView(LaunchpadEditFormView):
schema = IDistributionMirror
- field_names = ["name", "displayname", "description", "whiteboard",
- "http_base_url", "ftp_base_url", "rsync_base_url", "speed",
- "country", "content", "official_candidate"]
+ field_names = [
+ "name", "display_name", "description", "whiteboard",
+ "http_base_url", "ftp_base_url", "rsync_base_url", "speed",
+ "country", "content", "official_candidate",
+ ]
+
@property
def label(self):
"""See `LaunchpadFormView`."""
=== modified file 'lib/lp/registry/browser/distroseries.py'
--- lib/lp/registry/browser/distroseries.py 2014-12-06 00:16:55 +0000
+++ lib/lp/registry/browser/distroseries.py 2015-10-13 13:37:18 +0000
@@ -552,7 +552,7 @@
It redirects to the main distroseries page after a successful edit.
"""
schema = IDistroSeries
- field_names = ['displayname', 'title', 'summary', 'description']
+ field_names = ['display_name', 'title', 'summary', 'description']
custom_widget('status', LaunchpadDropdownWidget)
@property
@@ -657,8 +657,8 @@
IDistroSeries["version"], description=_(
"The version of the new series."))
- displayname = copy_field(
- IDistroSeries["displayname"], description=_(
+ display_name = copy_field(
+ IDistroSeries["display_name"], description=_(
"The name of the new series as it would "
"appear in a paragraph."))
@@ -671,7 +671,7 @@
field_names = [
'name',
'version',
- 'displayname',
+ 'display_name',
'summary',
]
@@ -693,8 +693,8 @@
# previous_series will be None if there isn't one.
distroseries = self.context.newSeries(
name=data['name'],
- displayname=data['displayname'],
- title=data['displayname'],
+ display_name=data['display_name'],
+ title=data['display_name'],
summary=data['summary'],
description=u"",
version=data['version'],
=== modified file 'lib/lp/registry/browser/tests/distribution-views.txt'
--- lib/lp/registry/browser/tests/distribution-views.txt 2015-06-26 14:00:41 +0000
+++ lib/lp/registry/browser/tests/distribution-views.txt 2015-10-13 13:37:18 +0000
@@ -66,14 +66,14 @@
The view accepts the basic fields to register a distribution.
>>> view.field_names
- ['name', 'displayname', 'summary', 'description', 'domainname',
+ ['name', 'display_name', 'summary', 'description', 'domainname',
'members', 'official_malone', 'blueprints_usage', 'translations_usage',
'answers_usage']
>>> login("admin@xxxxxxxxxxxxx")
>>> form = {
... 'field.name': 'youbuntu',
- ... 'field.displayname': 'YoUbuntu',
+ ... 'field.display_name': 'YoUbuntu',
... 'field.summary': 'summary',
... 'field.description': 'description',
... 'field.domainname': 'youbuntu.me',
@@ -127,7 +127,7 @@
<DBItem ServiceUsage.UNKNOWN, (10) Unknown>
>>> view.field_names
- ['displayname', 'summary', 'description',
+ ['display_name', 'summary', 'description',
'bug_reporting_guidelines', 'bug_reported_acknowledgement',
'package_derivatives_email', 'icon',
'logo', 'mugshot', 'official_malone', 'enable_bug_expiration',
=== modified file 'lib/lp/registry/browser/tests/distributionmirror-views.txt'
--- lib/lp/registry/browser/tests/distributionmirror-views.txt 2015-06-26 14:00:41 +0000
+++ lib/lp/registry/browser/tests/distributionmirror-views.txt 2015-10-13 13:37:18 +0000
@@ -47,12 +47,12 @@
A HTTP or FTP URL is required to register a mirror.
>>> view.field_names
- ['displayname', 'description', 'whiteboard', 'http_base_url',
+ ['display_name', 'description', 'whiteboard', 'http_base_url',
'ftp_base_url', 'rsync_base_url', 'speed', 'country', 'content',
'official_candidate']
>>> form = {
- ... 'field.displayname': 'Illuminati',
+ ... 'field.display_name': 'Illuminati',
... 'field.description': 'description',
... 'field.whiteboard': 'whiteboard',
... 'field.http_base_url': 'http://secret.me/',
@@ -239,7 +239,7 @@
The user can edit the mirror fields.
>>> view.field_names
- ['name', 'displayname', 'description', 'whiteboard', 'http_base_url',
+ ['name', 'display_name', 'description', 'whiteboard', 'http_base_url',
'ftp_base_url', 'rsync_base_url', 'speed', 'country', 'content',
'official_candidate']
=== modified file 'lib/lp/registry/browser/tests/distroseries-views.txt'
--- lib/lp/registry/browser/tests/distroseries-views.txt 2015-07-21 09:04:01 +0000
+++ lib/lp/registry/browser/tests/distroseries-views.txt 2015-10-13 13:37:18 +0000
@@ -154,7 +154,7 @@
---------------------
The distroseries edit view allows the editor to change series. The form
-uses the displayname, title, and description fields.
+uses the display_name, title, and description fields.
>>> driver = factory.makePerson(name='ubuntu-driver')
>>> hoary.driver = driver
@@ -170,14 +170,14 @@
http://launchpad.dev/ubuntu/hoary
>>> [field.__name__ for field in view.form_fields]
- ['displayname', 'title', 'summary', 'description']
+ ['display_name', 'title', 'summary', 'description']
Admins can see the status field for full functionality distributions.
>>> login('admin@xxxxxxxxxxxxx')
>>> view = create_initialized_view(hoary, '+edit')
>>> [field.__name__ for field in view.form_fields]
- ['displayname', 'title', 'summary', 'description', 'status']
+ ['display_name', 'title', 'summary', 'description', 'status']
Series that belong to derivative distributions also contain the status field.
@@ -195,7 +195,7 @@
Edit Melon details
>>> [field.__name__ for field in view.form_fields]
- ['displayname', 'title', 'summary', 'description', 'status']
+ ['display_name', 'title', 'summary', 'description', 'status']
>>> print view.widgets.get('status')._getFormValue().title
Active Development
@@ -220,13 +220,13 @@
None
>>> view.field_names
- ['name', 'version', 'displayname', 'summary']
+ ['name', 'version', 'display_name', 'summary']
A distroseries is created whent the required field are submitted.
>>> form = {
... 'field.name': 'sane',
- ... 'field.displayname': 'Sane Name',
+ ... 'field.display_name': 'Sane Name',
... 'field.summary': 'A stable series to introduce fnord.',
... 'field.version': '2009.06',
... 'field.actions.create': 'Create Series',
@@ -266,14 +266,14 @@
>>> yo_form = dict(form)
>>> yo_form['field.name'] = 'island'
- >>> yo_form['field.displayname'] = 'Island'
+ >>> yo_form['field.display_name'] = 'Island'
>>> view = create_initialized_view(
... youbuntu, name='+addseries', form=yo_form, principal=yo_driver)
>>> view.errors
[]
>>> yo_series = youbuntu.getSeries('island')
- >>> print yo_series.displayname
+ >>> print yo_series.display_name
Island
But drivers of distributions that use Soyuz officially (eg. Ubuntu)
@@ -307,7 +307,7 @@
>>> yo_form = dict(form)
>>> del yo_form['field.actions.create']
- >>> yo_form['field.displayname'] = 'Mountain'
+ >>> yo_form['field.display_name'] = 'Mountain'
>>> yo_form['field.summary'] = 'Mountain summary'
>>> yo_form['field.actions.change'] = 'Change'
>>> view = create_initialized_view(
@@ -315,7 +315,7 @@
>>> view.errors
[]
- >>> print yo_series.displayname
+ >>> print yo_series.display_name
Mountain
Drivers of packages with packages such as Ubuntu cannot edit a series.
=== modified file 'lib/lp/registry/browser/tests/test_distribution_views.py'
--- lib/lp/registry/browser/tests/test_distribution_views.py 2015-09-25 13:54:46 +0000
+++ lib/lp/registry/browser/tests/test_distribution_views.py 2015-10-13 13:37:18 +0000
@@ -122,7 +122,7 @@
def getDefaultAddDict(self):
return {
'field.name': 'newbuntu',
- 'field.displayname': 'newbuntu',
+ 'field.display_name': 'newbuntu',
'field.title': 'newbuntu',
'field.summary': 'newbuntu',
'field.description': 'newbuntu',
@@ -219,7 +219,7 @@
def getDefaultEditDict(self):
return {
- 'field.displayname': 'newbuntu',
+ 'field.display_name': 'newbuntu',
'field.title': 'newbuntu',
'field.summary': 'newbuntu',
'field.description': 'newbuntu',
=== modified file 'lib/lp/registry/browser/tests/test_distroseries.py'
--- lib/lp/registry/browser/tests/test_distroseries.py 2015-10-01 10:25:19 +0000
+++ lib/lp/registry/browser/tests/test_distroseries.py 2015-10-13 13:37:18 +0000
@@ -622,7 +622,7 @@
form = {
"field.name": u"polished",
"field.version": u"12.04",
- "field.displayname": u"Polished Polecat",
+ "field.display_name": u"Polished Polecat",
"field.summary": u"Even The Register likes it.",
"field.actions.create": u"Add Series",
}
@@ -635,7 +635,7 @@
def assertCreated(self, distroseries):
self.assertEqual(u"polished", distroseries.name)
self.assertEqual(u"12.04", distroseries.version)
- self.assertEqual(u"Polished Polecat", distroseries.displayname)
+ self.assertEqual(u"Polished Polecat", distroseries.display_name)
self.assertEqual(u"Polished Polecat", distroseries.title)
self.assertEqual(u"Even The Register likes it.", distroseries.summary)
self.assertEqual(u"", distroseries.description)
@@ -643,7 +643,7 @@
def test_plain_submit(self):
# When creating a new DistroSeries via DistroSeriesAddView, the title
- # is set to the same as the displayname (title is, in any case,
+ # is set to the same as the display_name (title is, in any case,
# deprecated), the description is left empty, and previous_series is
# None (DistroSeriesInitializeView takes care of setting that).
distroseries = self.createNewDistroseries()
=== modified file 'lib/lp/registry/configure.zcml'
--- lib/lp/registry/configure.zcml 2015-10-12 16:16:28 +0000
+++ lib/lp/registry/configure.zcml 2015-10-13 13:37:18 +0000
@@ -310,7 +310,7 @@
<require
permission="launchpad.Edit"
set_attributes="
- displayname
+ display_name
title
summary
description
@@ -1760,7 +1760,7 @@
bug_reporting_guidelines
description
development_series_alias
- displayname
+ display_name
driver
enable_bug_expiration
homepage_content
@@ -1982,6 +1982,7 @@
attributes="
id
name
+ display_name
displayname
description
distribution
@@ -2023,7 +2024,7 @@
canTransitionToCountryMirror" />
<require
permission="launchpad.Edit"
- set_attributes="name displayname description whiteboard
+ set_attributes="name display_name description whiteboard
http_base_url ftp_base_url rsync_base_url enabled
speed country content official_candidate owner"
attributes="official_candidate whiteboard" />
=== modified file 'lib/lp/registry/doc/distroseries.txt'
--- lib/lp/registry/doc/distroseries.txt 2015-04-09 05:16:37 +0000
+++ lib/lp/registry/doc/distroseries.txt 2015-10-13 13:37:18 +0000
@@ -20,7 +20,6 @@
>>> from zope.component import getUtility
- >>> from lp.services.database.sqlbase import flush_database_updates
>>> from lp.testing import verifyObject
>>> from lp.registry.interfaces.distribution import IDistributionSet
>>> from lp.registry.interfaces.distroseries import (
@@ -107,14 +106,14 @@
>>> print warty.title
The Warty Warthog Release
-And a displayname for referring to it in a sentence.
+And a display_name for referring to it in a sentence.
- >>> print warty.displayname
+ >>> print warty.display_name
Warty
The fullseriesname attribute is used when the context of the series name
can be confused. Note that the value is created from the launchpad id names
-of the distribution and the series, though it may look like the displayname
+of the distribution and the series, though it may look like the display_name
attributes were used.
>>> print warty.fullseriesname
@@ -125,7 +124,7 @@
>>> print warty.version
4.10
-The named_version attribute is used is used to present the series displayname
+The named_version attribute is used is used to present the series display_name
and version values consistently.
>>> print warty.named_version
@@ -670,7 +669,7 @@
False
>>> yo_series = youbuntu.newSeries(
- ... name='island', displayname='Island', title='YouBuntu Island',
+ ... name='island', display_name='Island', title='YouBuntu Island',
... summary='summary', description='description', version='09.07',
... previous_series=warty, registrant=yo_driver)
>>> print yo_series.name
@@ -686,7 +685,7 @@
>>> ignored = login_person(youbuntu.owner)
>>> yo_series = youbuntu.newSeries(
- ... name='forest', displayname='Forest', title='YouBuntu Forest',
+ ... name='forest', display_name='Forest', title='YouBuntu Forest',
... summary='summary', description='description', version='09.07',
... previous_series=warty, registrant=youbuntu.owner)
>>> print yo_series.name
@@ -702,7 +701,7 @@
>>> ubuntu.driver = yo_driver
>>> ignored = login_person(yo_driver)
>>> ubuntu.newSeries(
- ... name='finch', displayname='Finch', title='Ubuntu Finch',
+ ... name='finch', display_name='Finch', title='Ubuntu Finch',
... summary='summary', description='description', version='9.06',
... previous_series=warty, owner=ubuntu.driver)
Traceback (most recent call last):
@@ -714,7 +713,7 @@
>>> ignored = login_person(ubuntu.owner.activemembers[0])
>>> u_series = ubuntu.newSeries(
- ... name='finch', displayname='Finch', title='Ubuntu Finch',
+ ... name='finch', display_name='Finch', title='Ubuntu Finch',
... summary='summary', description='description', version='9.06',
... previous_series=warty, registrant=ubuntu.owner)
>>> print u_series.name
=== modified file 'lib/lp/registry/interfaces/distribution.py'
--- lib/lp/registry/interfaces/distribution.py 2015-05-14 02:03:31 +0000
+++ lib/lp/registry/interfaces/distribution.py 2015-10-13 13:37:18 +0000
@@ -128,7 +128,7 @@
class IDistributionDriverRestricted(Interface):
"""IDistribution properties requiring launchpad.Driver permission."""
- def newSeries(name, displayname, title, summary, description,
+ def newSeries(name, display_name, title, summary, description,
version, previous_series, registrant):
"""Creates a new distroseries."""
@@ -148,12 +148,12 @@
title=_("Name"),
constraint=name_validator,
description=_("The distro's name."), required=True))
- displayname = exported(
+ display_name = exported(
TextLine(
title=_("Display Name"),
description=_("The displayable name of the distribution."),
- required=True),
- exported_as='display_name')
+ required=True))
+ displayname = Attribute("Display name (deprecated)")
title = exported(
Title(
title=_("Title"),
@@ -490,7 +490,7 @@
def getCountryMirror(country, mirror_type):
"""Return the country DNS mirror for a country and content type."""
- def newMirror(owner, speed, country, content, displayname=None,
+ def newMirror(owner, speed, country, content, display_name=None,
description=None, http_base_url=None,
ftp_base_url=None, rsync_base_url=None, enabled=False,
official_candidate=False, whiteboard=None):
@@ -704,7 +704,7 @@
def getByName(distroname):
"""Return the IDistribution with the given name or None."""
- def new(name, displayname, title, description, summary, domainname,
+ def new(name, display_name, title, description, summary, domainname,
members, owner, registrant, mugshot=None, logo=None, icon=None):
"""Create a new distribution."""
=== modified file 'lib/lp/registry/interfaces/distributionmirror.py'
--- lib/lp/registry/interfaces/distributionmirror.py 2015-09-28 17:38:45 +0000
+++ lib/lp/registry/interfaces/distributionmirror.py 2015-10-13 13:37:18 +0000
@@ -328,9 +328,13 @@
title=_('Name'), required=True, readonly=False,
description=_('A short and unique name for this mirror.'),
constraint=name_validator))
- displayname = exported(TextLine(
- title=_('Organisation'), required=False, readonly=False,
- description=_('The name of the organization hosting this mirror.')))
+ display_name = exported(
+ TextLine(
+ title=_('Organisation'), required=False, readonly=False,
+ description=_(
+ 'The name of the organization hosting this mirror.')),
+ exported_as='displayname')
+ displayname = Attribute('Display name (deprecated)')
description = exported(TextLine(
title=_('Description'), required=False, readonly=False))
http_base_url = exported(DistroMirrorHTTPURIField(
=== modified file 'lib/lp/registry/interfaces/distroseries.py'
--- lib/lp/registry/interfaces/distroseries.py 2015-07-21 09:04:01 +0000
+++ lib/lp/registry/interfaces/distroseries.py 2015-10-13 13:37:18 +0000
@@ -185,10 +185,12 @@
title=_("Name"), required=True,
description=_("The name of this series."),
constraint=name_validator))
- displayname = exported(
+ display_name = exported(
TextLine(
title=_("Display name"), required=True,
- description=_("The series displayname.")))
+ description=_("The series displayname.")),
+ exported_as="displayname")
+ displayname = Attribute("Display name (deprecated)")
fullseriesname = exported(
TextLine(
title=_("Series full name"), required=False,
=== modified file 'lib/lp/registry/model/distribution.py'
--- lib/lp/registry/model/distribution.py 2015-07-08 16:05:11 +0000
+++ lib/lp/registry/model/distribution.py 2015-10-13 13:37:18 +0000
@@ -86,8 +86,8 @@
from lp.registry.enums import (
BranchSharingPolicy,
BugSharingPolicy,
+ SpecificationSharingPolicy,
VCSType,
- SpecificationSharingPolicy,
)
from lp.registry.errors import NoSuchDistroSeries
from lp.registry.interfaces.accesspolicy import IAccessPolicySource
@@ -201,7 +201,7 @@
_defaultOrder = 'name'
name = StringCol(notNull=True, alternateID=True, unique=True)
- displayname = StringCol(notNull=True)
+ display_name = StringCol(dbName='displayname', notNull=True)
_title = StringCol(dbName='title', notNull=True)
summary = StringCol(notNull=True)
description = StringCol(notNull=True)
@@ -251,13 +251,17 @@
vcs = EnumCol(enum=VCSType, notNull=False)
def __repr__(self):
- displayname = self.displayname.encode('ASCII', 'backslashreplace')
+ display_name = self.display_name.encode('ASCII', 'backslashreplace')
return "<%s '%s' (%s)>" % (
- self.__class__.__name__, displayname, self.name)
+ self.__class__.__name__, display_name, self.name)
+
+ @property
+ def displayname(self):
+ return self.display_name
@property
def title(self):
- return self.displayname
+ return self.display_name
@property
def pillar(self):
@@ -614,7 +618,7 @@
@property
def bugtargetdisplayname(self):
"""See IBugTarget."""
- return self.displayname
+ return self.display_name
@property
def bugtargetname(self):
@@ -703,7 +707,7 @@
content=mirror_type,
country_dns_mirror=True).one()
- def newMirror(self, owner, speed, country, content, displayname=None,
+ def newMirror(self, owner, speed, country, content, display_name=None,
description=None, http_base_url=None,
ftp_base_url=None, rsync_base_url=None,
official_candidate=False, enabled=False,
@@ -737,7 +741,7 @@
return DistributionMirror(
distribution=self, owner=owner, name=name, speed=speed,
- country=country, content=content, displayname=displayname,
+ country=country, content=content, display_name=display_name,
description=description, http_base_url=urls['http_base_url'],
ftp_base_url=urls['ftp_base_url'],
rsync_base_url=urls['rsync_base_url'],
@@ -1321,13 +1325,13 @@
admins = getUtility(ILaunchpadCelebrities).admin
return user.inTeam(self.owner) or user.inTeam(admins)
- def newSeries(self, name, displayname, title, summary,
+ def newSeries(self, name, display_name, title, summary,
description, version, previous_series, registrant):
"""See `IDistribution`."""
series = DistroSeries(
distribution=self,
name=name,
- displayname=displayname,
+ display_name=display_name,
title=title,
summary=summary,
description=description,
@@ -1449,13 +1453,13 @@
return None
return pillar
- def new(self, name, displayname, title, description, summary, domainname,
+ def new(self, name, display_name, title, description, summary, domainname,
members, owner, registrant, mugshot=None, logo=None, icon=None,
vcs=None):
"""See `IDistributionSet`."""
distro = Distribution(
name=name,
- displayname=displayname,
+ display_name=display_name,
_title=title,
description=description,
summary=summary,
=== modified file 'lib/lp/registry/model/distributionmirror.py'
--- lib/lp/registry/model/distributionmirror.py 2015-09-28 17:38:45 +0000
+++ lib/lp/registry/model/distributionmirror.py 2015-10-13 13:37:18 +0000
@@ -122,8 +122,8 @@
dbName='distribution', foreignKey='Distribution', notNull=True)
name = StringCol(
alternateID=True, notNull=True)
- displayname = StringCol(
- notNull=False, default=None)
+ display_name = StringCol(
+ dbName='displayname', notNull=False, default=None)
description = StringCol(
notNull=False, default=None)
http_base_url = StringCol(
@@ -173,10 +173,14 @@
distribution_mirror=self, orderBy='-date_created')
@property
+ def displayname(self):
+ return self.display_name
+
+ @property
def title(self):
"""See IDistributionMirror"""
- if self.displayname:
- return self.displayname
+ if self.display_name:
+ return self.display_name
else:
return self.name.capitalize()
=== modified file 'lib/lp/registry/model/distroseries.py'
--- lib/lp/registry/model/distroseries.py 2015-07-09 20:06:17 +0000
+++ lib/lp/registry/model/distroseries.py 2015-10-13 13:37:18 +0000
@@ -217,7 +217,7 @@
distribution = ForeignKey(
dbName='distribution', foreignKey='Distribution', notNull=True)
name = StringCol()
- displayname = StringCol(notNull=True)
+ display_name = StringCol(dbName='displayname', notNull=True)
title = StringCol(notNull=True)
description = StringCol(notNull=True)
version = StringCol(notNull=True)
@@ -262,6 +262,10 @@
intermediateTable='SectionSelection')
@property
+ def displayname(self):
+ return self.display_name
+
+ @property
def pillar(self):
"""See `IBugTarget`."""
return self.distribution
@@ -273,7 +277,7 @@
@property
def named_version(self):
- return '%s (%s)' % (self.displayname, self.version)
+ return '%s (%s)' % (self.display_name, self.version)
@property
def upload_components(self):
=== modified file 'lib/lp/registry/stories/distributionmirror/xx-distribution-mirrors.txt'
--- lib/lp/registry/stories/distributionmirror/xx-distribution-mirrors.txt 2011-09-18 19:00:21 +0000
+++ lib/lp/registry/stories/distributionmirror/xx-distribution-mirrors.txt 2015-10-13 13:37:18 +0000
@@ -130,7 +130,7 @@
>>> # Register an unreviewed archive mirror.
>>> browser.open('http://launchpad.dev/ubuntu/+newmirror')
>>> browser.getControl(
- ... name='field.displayname').value = 'Kabul LUG mirror'
+ ... name='field.display_name').value = 'Kabul LUG mirror'
>>> browser.getControl(name='field.ftp_base_url').value = (
... 'ftp://kabullug.org/ubuntu')
>>> browser.getControl(name='field.country').value = ['1'] # Afghanistan
=== modified file 'lib/lp/registry/tests/test_distribution.py'
--- lib/lp/registry/tests/test_distribution.py 2015-02-13 10:43:03 +0000
+++ lib/lp/registry/tests/test_distribution.py 2015-10-13 13:37:18 +0000
@@ -352,7 +352,7 @@
# Cache cleared.
distribution.newSeries(
- name='bar', displayname='Bar', title='Bar', summary='',
+ name='bar', display_name='Bar', title='Bar', summary='',
description='', version='1', previous_series=None,
registrant=self.factory.makePerson())
self.assertNotIn("series", cache)
=== modified file 'lib/lp/registry/tests/test_distributionsourcepackage.py'
--- lib/lp/registry/tests/test_distributionsourcepackage.py 2015-02-26 11:34:47 +0000
+++ lib/lp/registry/tests/test_distributionsourcepackage.py 2015-10-13 13:37:18 +0000
@@ -41,7 +41,7 @@
distribution_set = getUtility(IDistributionSet)
distribution = distribution_set.new(name='wart',
- displayname='wart', title='wart', description='lots of warts',
+ display_name='wart', title='wart', description='lots of warts',
summary='lots of warts', domainname='wart.dumb',
members=self.factory.makeTeam(), owner=self.factory.makePerson(),
registrant=self.factory.makePerson())
=== modified file 'lib/lp/registry/vocabularies.py'
--- lib/lp/registry/vocabularies.py 2015-10-01 10:25:19 +0000
+++ lib/lp/registry/vocabularies.py 2015-10-13 13:37:18 +0000
@@ -1643,7 +1643,7 @@
DistroSeries.distribution == Distribution.id,
*where)
query = query.order_by(
- Distribution.displayname,
+ Distribution.display_name,
Desc(DistroSeries.date_created)).config(distinct=True)
return [series for (series, distribution) in query]
=== modified file 'lib/lp/testing/factory.py'
--- lib/lp/testing/factory.py 2015-10-01 17:32:41 +0000
+++ lib/lp/testing/factory.py 2015-10-13 13:37:18 +0000
@@ -2620,7 +2620,7 @@
series = naked_distribution.newSeries(
version=version,
name=name,
- displayname=displayname,
+ display_name=displayname,
title=self.getUniqueString(), summary=self.getUniqueString(),
description=self.getUniqueString(),
previous_series=previous_series, registrant=registrant)
@@ -3408,7 +3408,7 @@
speed=MirrorSpeed.S256K,
country=country,
content=MirrorContent.ARCHIVE,
- displayname=displayname,
+ display_name=displayname,
description=None,
http_base_url=http_url,
ftp_base_url=ftp_url,
=== modified file 'lib/lp/translations/model/translationgroup.py'
--- lib/lp/translations/model/translationgroup.py 2015-10-01 17:32:41 +0000
+++ lib/lp/translations/model/translationgroup.py 2015-10-13 13:37:18 +0000
@@ -254,7 +254,7 @@
)
distro_data = ISlaveStore(Distribution).using(*using).find(
tables, Distribution.translationgroupID == self.id).order_by(
- Distribution.displayname)
+ Distribution.display_name)
return DecoratedResultSet(distro_data, operator.itemgetter(0))
=== modified file 'utilities/soyuz-sampledata-setup.py'
--- utilities/soyuz-sampledata-setup.py 2015-05-07 09:29:30 +0000
+++ utilities/soyuz-sampledata-setup.py 2015-10-13 13:37:18 +0000
@@ -194,9 +194,9 @@
registrant = parent.owner
name = full_name.split()[0].lower()
title = "The " + full_name
- displayname = full_name.split()[0]
+ display_name = full_name.split()[0]
new_series = distribution.newSeries(name=name, title=title,
- displayname=displayname, summary='Ubuntu %s is good.' % version,
+ display_name=display_name, summary='Ubuntu %s is good.' % version,
description='%s is awesome.' % version, version=version,
previous_series=None, registrant=registrant)
new_series.status = status
Follow ups