2013-09-30 17:34:16 +03:00
|
|
|
import rethinkdb as rdb
|
|
|
|
from reimagine import conn
|
2013-10-02 04:50:48 +03:00
|
|
|
from rethinkORM import RethinkModel
|
2013-09-29 00:09:02 +03:00
|
|
|
|
|
|
|
|
2013-10-02 04:50:48 +03:00
|
|
|
class BaseModel(RethinkModel):
|
2013-09-29 00:09:02 +03:00
|
|
|
|
2013-10-02 04:50:48 +03:00
|
|
|
def __init__(self, **kwargs):
|
|
|
|
if not kwargs.get('conn'):
|
|
|
|
kwargs['conn'] = conn
|
2013-09-29 00:09:02 +03:00
|
|
|
|
2013-10-02 04:50:48 +03:00
|
|
|
super(BaseModel, self).__init__(**kwargs)
|
2013-09-29 00:09:02 +03:00
|
|
|
|
|
|
|
@classmethod
|
2013-10-02 04:50:48 +03:00
|
|
|
def create(cls, **kwargs):
|
|
|
|
return super(BaseModel, cls).create(**kwargs)
|
2013-09-29 00:09:02 +03:00
|
|
|
|
|
|
|
|
|
|
|
class Site(BaseModel):
|
2013-10-02 04:50:48 +03:00
|
|
|
table = 'sites'
|
2013-09-29 00:09:02 +03:00
|
|
|
|
2013-10-02 04:50:48 +03:00
|
|
|
|
|
|
|
class User(BaseModel):
|
|
|
|
table = 'users'
|
|
|
|
|
|
|
|
|
|
|
|
def login(self, login, password):
|
|
|
|
pass
|