def register(i): isvarchar(i.email,1,50) isvarchar(i.password,1,100) return db.insert('users', id=i.id,email=i.email,password=i.password,registerdate=datetime.now(),status=1, _test=is_debug)
def create(i): isint(i.userid) isvarchar(i.name,1,50) return db.insert('groups', userid=i.userid,name=i.name,createdate=datetime.now(), _test=is_debug)
def changepwd(i): isbigint(i.id) isvarchar(i.email,1,50) isvarchar(i.password,1,100) isdatetime(i.registerdate) isdatetime(i.lastlogindate) issmallint(i.status) id = i.id db.update('users',where='id=$id', id=i.id,email=i.email,password=i.password,registerdate=i.registerdate,lastlogindate=i.lastlogindate,status=i.status, vars=locals(),_test=is_debug)
def update(i): isint(i.id) isvarchar(i.name,1,50) id = i.id db.update('groups',where='id=$id',name=i.name, vars=locals(),_test=is_debug)