~barry/mailman/events-and-web

« back to all changes in this revision

Viewing changes to src/mailman/model/mailinglist.py

  • Committer: Barry Warsaw
  • Date: 2011-09-23 23:47:19 UTC
  • Revision ID: barry@list.org-20110923234719-fp31k6ch59oh3cvf
Improved the way flufl.enum.Enums are stored in the database.  Now, they
should always be stored as INTEGER columns, with the enum class explicitly
described in the code.  This should be more efficient, and besides EIBTI.

Also, filled in a few additional IMailingList attributes which were not
documented in the interface.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
from mailman.config import config
39
39
from mailman.database.model import Model
40
40
from mailman.database.types import Enum
 
41
from mailman.interfaces.action import Action
41
42
from mailman.interfaces.address import IAddress
 
43
from mailman.interfaces.autorespond import ResponseAction
 
44
from mailman.interfaces.bounce import UnrecognizedBounceDisposition
 
45
from mailman.interfaces.digests import DigestFrequency
42
46
from mailman.interfaces.domain import IDomainManager
43
47
from mailman.interfaces.languages import ILanguageManager
44
48
from mailman.interfaces.mailinglist import (
45
 
    IAcceptableAlias, IAcceptableAliasSet, IMailingList, Personalization)
 
49
    IAcceptableAlias, IAcceptableAliasSet, IMailingList, Personalization,
 
50
    ReplyToMunging)
46
51
from mailman.interfaces.member import (
47
52
    AlreadySubscribedError, MemberRole, MissingPreferredAddressError)
48
53
from mailman.interfaces.mime import FilterType
 
54
from mailman.interfaces.nntp import NewsModeration
49
55
from mailman.interfaces.user import IUser
50
56
from mailman.model import roster
51
57
from mailman.model.digests import OneLastDigest
103
109
    archive_volume_frequency = Int() # XXX
104
110
    # Automatic responses.
105
111
    autoresponse_grace_period = TimeDelta()
106
 
    autorespond_owner = Enum()
 
112
    autorespond_owner = Enum(ResponseAction)
107
113
    autoresponse_owner_text = Unicode()
108
 
    autorespond_postings = Enum()
 
114
    autorespond_postings = Enum(ResponseAction)
109
115
    autoresponse_postings_text = Unicode()
110
 
    autorespond_requests = Enum()
 
116
    autorespond_requests = Enum(ResponseAction)
111
117
    autoresponse_request_text = Unicode()
112
118
    # Content filters.
113
119
    filter_content = Bool()
121
127
    bounce_score_threshold = Int() # XXX
122
128
    bounce_you_are_disabled_warnings = Int() # XXX
123
129
    bounce_you_are_disabled_warnings_interval = TimeDelta() # XXX
124
 
    forward_unrecognized_bounces_to = Enum()
 
130
    forward_unrecognized_bounces_to = Enum(UnrecognizedBounceDisposition)
125
131
    process_bounces = Bool()
126
132
    # Miscellaneous
127
 
    default_member_action = Enum()
128
 
    default_nonmember_action = Enum()
 
133
    default_member_action = Enum(Action)
 
134
    default_nonmember_action = Enum(Action)
129
135
    description = Unicode()
130
136
    digest_footer = Unicode()
131
137
    digest_header = Unicode()
132
138
    digest_is_default = Bool()
133
139
    digest_send_periodic = Bool()
134
140
    digest_size_threshold = Float()
135
 
    digest_volume_frequency = Enum()
 
141
    digest_volume_frequency = Enum(DigestFrequency)
136
142
    digestable = Bool()
137
143
    discard_these_nonmembers = Pickle()
138
144
    emergency = Bool()
156
162
    msg_footer = Unicode()
157
163
    msg_header = Unicode()
158
164
    new_member_options = Int()
159
 
    news_moderation = Enum()
 
165
    news_moderation = Enum(NewsModeration)
160
166
    news_prefix_subject_too = Bool()
161
167
    nntp_host = Unicode()
162
168
    nondigestable = Bool()
163
169
    nonmember_rejection_notice = Unicode()
164
170
    obscure_addresses = Bool()
165
 
    personalize = Enum()
 
171
    personalize = Enum(Personalization)
166
172
    pipeline = Unicode()
167
173
    post_id = Int()
168
174
    _preferred_language = Unicode(name='preferred_language')
169
175
    private_roster = Bool()
170
176
    real_name = Unicode()
171
177
    reject_these_nonmembers = Pickle()
172
 
    reply_goes_to_list = Enum()
 
178
    reply_goes_to_list = Enum(ReplyToMunging)
173
179
    reply_to_address = Unicode()
174
180
    require_explicit_destination = Bool()
175
181
    respond_to_post_requests = Bool()