(self, method, lookup, rdb)
Lookup the user by the uid
Lookup the user by the uid
Lookup the user by the uid
def get(self, method, lookup, rdb):
        ''' Lookup the user by the uid '''
        if method == 'uid':
            uid = lookup
        elif method == 'username':
            uid = self.getUID(lookup, rdb)
        results = r.table('users').get(uid).run(rdb)
        data = results
        if data:
            self.email = results['email']
            self.uid = results['id']
            self.username = results['username']
            self.status = results['status']
            self.company = results['company']
            self.contact = results['contact']
            self.acttype = results['acttype']
            self.stripeid = results['stripeid']
            self.stripe = results['stripe']
            self.subplans = results['subplans']
            self.payments = results['payments']
            self.subscription = results['subscription']
            self.creation_time = results['creation_time']
            self.confirmed = results['confirmed']
            ## Identify number of monitors and reactions
            monitor = Monitor()
            reaction = Reaction()
            self.monitorCount = monitor.count(self.uid, rdb)
            self.reactionCount = reaction.count(self.uid, rdb)
            return self
        else:
            return None
def get ( self , method , lookup , rdb ) : if method == 'uid' : uid = lookup elif method == 'username' : uid = self . getUID ( lookup , rdb ) results = r . table ( 'users' ) . get ( uid ) . run ( rdb ) data = results if data : self . email = results [ 'email' ] self . uid = results [ 'id' ] self . username = results [ 'username' ] self . status = results [ 'status' ] self . company = results [ 'company' ] self . contact = results [ 'contact' ] self . acttype = results [ 'acttype' ] self . stripeid = results [ 'stripeid' ] self . stripe = results [ 'stripe' ] self . subplans = results [ 'subplans' ] self . payments = results [ 'payments' ] self . subscription = results [ 'subscription' ] self . creation_time = results [ 'creation_time' ] self . confirmed = results [ 'confirmed' ] ## Identify number of monitors and reactions monitor = Monitor ( ) reaction = Reaction ( ) self . monitorCount = monitor . count ( self . uid , rdb ) self . reactionCount = reaction . count ( self . uid , rdb ) return self else : return None