X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-database.git/blobdiff_plain/5641962504f19a365cbab009f88ba58d93dce0d2..a0c4946af484258fcca9ce913abd2546da6558dd:/python/database/models.py diff --git a/python/database/models.py b/python/database/models.py index 80749ff..d4f2694 100644 --- a/python/database/models.py +++ b/python/database/models.py @@ -16,6 +16,7 @@ def session_mapper(scoped_session): def __init__(self, **kwargs): for key, value in kwargs.items(): setattr(self, key, value) + scoped_session.add(self) cls.__init__ = __init__ cls.query = scoped_session.query_property() return sqla_mapper(cls, *arg, **kw)