first implementation of protobuf
restructure in client server model loads of work still missing
This commit is contained in:
@@ -13,23 +13,5 @@
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
from json import JSONEncoder
|
||||
|
||||
from sqlalchemy.orm import sessionmaker, scoped_session
|
||||
from sqlalchemy.ext.declarative import declarative_base
|
||||
|
||||
VERSION = "0.1"
|
||||
|
||||
engine = None
|
||||
session = scoped_session(sessionmaker())
|
||||
""" :type : sqlalchemy.orm.scoping.scoped_session """
|
||||
Base = declarative_base()
|
||||
Base.query = session.query_property()
|
||||
|
||||
|
||||
def _default(self, obj):
|
||||
return getattr(obj.__class__, "to_json", _default.default)(obj)
|
||||
|
||||
|
||||
_default.default = JSONEncoder().default
|
||||
JSONEncoder.default = _default
|
||||
VERSION = "0.2"
|
||||
|
Reference in New Issue
Block a user