realms-wiki/reimagine/models.py

27 lines
496 B
Python
Raw Normal View History

2013-10-02 04:50:48 +03:00
from rethinkORM import RethinkModel
2013-10-02 07:32:53 +03:00
from reimagine import conn
2013-10-02 04:50:48 +03:00
class BaseModel(RethinkModel):
2013-10-02 04:50:48 +03:00
def __init__(self, **kwargs):
if not kwargs.get('conn'):
kwargs['conn'] = conn
super(BaseModel, self).__init__(**kwargs)
@classmethod
2013-10-02 04:50:48 +03:00
def create(cls, **kwargs):
return super(BaseModel, cls).create(**kwargs)
class Site(BaseModel):
2013-10-02 04:50:48 +03:00
table = 'sites'
2013-10-02 04:50:48 +03:00
class User(BaseModel):
table = 'users'
def login(self, login, password):
pass