~barry/mailman/events-and-web

« back to all changes in this revision

Viewing changes to src/mailman/model/mime.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:
30
30
 
31
31
from mailman.database.model import Model
32
32
from mailman.database.types import Enum
33
 
from mailman.interfaces.mime import IContentFilter
 
33
from mailman.interfaces.mime import IContentFilter, FilterType
34
34
 
35
35
 
36
36
 
43
43
    mailing_list_id = Int()
44
44
    mailing_list = Reference(mailing_list_id, 'MailingList.id')
45
45
 
46
 
    filter_type = Enum()
 
46
    filter_type = Enum(FilterType)
47
47
    filter_pattern = Unicode()
48
48
 
49
49
    def __init__(self, mailing_list, filter_pattern, filter_type):