Commit 583a7639 authored by Aurélien Bompard's avatar Aurélien Bompard Committed by Barry Warsaw

Rename from plural to singular

parent 741fdc63
......@@ -16,7 +16,7 @@ import sqlalchemy as sa
def upgrade():
# Create the new table
header_matches_table = op.create_table('headermatches',
header_match_table = op.create_table('headermatch',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('mailing_list_id', sa.Integer(), nullable=True),
sa.Column('header', sa.Unicode(), nullable=True),
......@@ -37,7 +37,7 @@ def upgrade():
)
for mlist_id, old_matches in connection.execute(mlist_table.select()):
for old_match in old_matches:
connection.execute(header_matches_table.insert().values(
connection.execute(header_match_table.insert().values(
mailing_list_id=mlist_id,
header=old_match[0],
pattern=old_match[1],
......@@ -66,17 +66,17 @@ def downgrade():
sa.sql.column('id', sa.Integer),
sa.sql.column('header_matches', sa.PickleType)
)
header_matches_table = sa.sql.table('headermatches',
header_match_table = sa.sql.table('headermatch',
sa.sql.column('mailing_list_id', sa.Integer),
sa.sql.column('header', sa.Unicode),
sa.sql.column('pattern', sa.Unicode),
)
for mlist_id, header, pattern in connection.execute(
header_matches_table.select()):
header_match_table.select()):
mlist = connection.execute(mlist_table.select().where(
mlist_table.c.id == mlist_id)).fetchone()
if not mlist["header_matches"]:
mlist["header_matches"] = []
mlist["header_matches"].append((header, pattern))
op.drop_table('headermatches')
op.drop_table('headermatch')
......@@ -842,8 +842,8 @@ class IListArchiverSet(Interface):
class IHeaderMatches(Interface):
"""Registration record for a single bounce event."""
class IHeaderMatch(Interface):
"""A header matching rule for mailinglist messages."""
mailing_list = Attribute(
"""The mailing list for the header match.""")
......
......@@ -38,7 +38,7 @@ from mailman.interfaces.domain import IDomainManager
from mailman.interfaces.languages import ILanguageManager
from mailman.interfaces.mailinglist import (
IAcceptableAlias, IAcceptableAliasSet, IListArchiver, IListArchiverSet,
IHeaderMatches, IMailingList, Personalization, ReplyToMunging,
IHeaderMatch, IMailingList, Personalization, ReplyToMunging,
SubscriptionPolicy)
from mailman.interfaces.member import (
AlreadySubscribedError, MemberRole, MissingPreferredAddressError,
......@@ -624,11 +624,11 @@ class ListArchiverSet:
@implementer(IHeaderMatches)
class HeaderMatches(Model):
"""See `IHeaderMatches`."""
@implementer(IHeaderMatch)
class HeaderMatch(Model):
"""See `IHeaderMatch`."""
__tablename__ = 'headermatches'
__tablename__ = 'headermatch'
id = Column(Integer, primary_key=True)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment