realms-wiki/reimagine/models.py
2013-10-01 20:50:48 -05:00

28 lines
520 B
Python

import rethinkdb as rdb
from reimagine import conn
from rethinkORM import RethinkModel
class BaseModel(RethinkModel):
def __init__(self, **kwargs):
if not kwargs.get('conn'):
kwargs['conn'] = conn
super(BaseModel, self).__init__(**kwargs)
@classmethod
def create(cls, **kwargs):
return super(BaseModel, cls).create(**kwargs)
class Site(BaseModel):
table = 'sites'
class User(BaseModel):
table = 'users'
def login(self, login, password):
pass