summaryrefslogtreecommitdiff
path: root/Mailman/database/model/language.py
diff options
context:
space:
mode:
authorBarry Warsaw2007-11-04 18:10:21 -0500
committerBarry Warsaw2007-11-04 18:10:21 -0500
commit46f480dfaa6286ff8950af817de1c35910b37e16 (patch)
tree194e8a3fb2150b7fa9ce5063a4b5b4acdf821365 /Mailman/database/model/language.py
parent85473d738ce8ec53ac518819832e0babc3558cf2 (diff)
downloadmailman-46f480dfaa6286ff8950af817de1c35910b37e16.tar.gz
mailman-46f480dfaa6286ff8950af817de1c35910b37e16.tar.zst
mailman-46f480dfaa6286ff8950af817de1c35910b37e16.zip
Target Mailman onto the Storm <http://storm.canonical.com> Python ORM. This
enables a few interesting things: 1. It makes it easier to do our "pillars of storage" idea, where list data and messages could live in one database, but user information live in a separate database. 2. It reduces the number of moving parts. SQLAlchemy and Elixir can both go away in favor of just one database layer. 3. No more Unicode/string mush hell. Somewhere along the way the upgrade to SQLAlchemy 0.4 and Elixir 0.4 made the strings coming out the database sometimes Unicode and sometimes 8-bit. This was totally unpredictable. Storm asserts that if a property is declared Unicode, it comes in and goes out as Unicode. 4. 'flush' is gone. One cost of this is that Storm does not yet currently support schema generation. So I cheat by dumping the trunk's SQLite schema and using that as a starting place for the Storm-based schema. I hope that Storm will eventually address this. Other related changes include: - SQLALCHEMY_ENGINE_URL is renamed to DEFAULT_DATABASE_URL. This may still get changed. Things I still want to fix: - Ickyness with clearing the databases. - Really implement multiple stores with better management of the Store instances. - Fix all the circular import nasties.
Diffstat (limited to 'Mailman/database/model/language.py')
-rw-r--r--Mailman/database/model/language.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/Mailman/database/model/language.py b/Mailman/database/model/language.py
index ffdbd2cba..a5229ab6a 100644
--- a/Mailman/database/model/language.py
+++ b/Mailman/database/model/language.py
@@ -15,14 +15,16 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
-from elixir import *
+from storm.locals import *
from zope.interface import implements
+from Mailman.database import Model
from Mailman.interfaces import ILanguage
-class Language(Entity):
+class Language(Model):
implements(ILanguage)
- code = Field(Unicode)
+ id = Int(primary=True)
+ code = Unicode()