~barry/mailman/events-and-web

« back to all changes in this revision

Viewing changes to src/mailman/model/preferences.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:
32
32
from mailman.database.model import Model
33
33
from mailman.database.types import Enum
34
34
from mailman.interfaces.languages import ILanguageManager
 
35
from mailman.interfaces.member import DeliveryMode, DeliveryStatus
35
36
from mailman.interfaces.preferences import IPreferences
36
37
 
37
38
 
45
46
    _preferred_language = Unicode(name='preferred_language')
46
47
    receive_list_copy = Bool()
47
48
    receive_own_postings = Bool()
48
 
    delivery_mode = Enum()
49
 
    delivery_status = Enum()
 
49
    delivery_mode = Enum(DeliveryMode)
 
50
    delivery_status = Enum(DeliveryStatus)
50
51
 
51
52
    def __repr__(self):
52
53
        return '<Preferences object at {0:#x}>'.format(id(self))