(self, rdb)
This will set a users subscription
        to the specified subscription plan
This will set a users subscription
        to the specified subscription plan
This will set a users subscription to the specified subscription plan
def setSubscription(self, rdb):
        '''
        This will set a users subscription
        to the specified subscription plan
        '''
        # Get User id
        results = r.table('users').get(self.uid).update(
            {
                'acttype': self.acttype,
                'stripeid': self.stripeid,
                'stripe': self.stripe,
                'subscription': self.subscription,
                'subplans': self.subplans
            }
        ).run(rdb)
        if results:
            loginfo = {}
            loginfo['type'] = "setSubscription"
            loginfo['uid'] = self.uid
            loginfo['acttype'] = self.acttype
            loginfo['subplans'] = self.subplans
            loginfo['subscription'] = self.subscription
            loginfo['time'] = time.time()
            logresult = r.table('subscription_history').insert(
                loginfo).run(rdb)
            return True
        else:
            return False
def setSubscription ( self , rdb ) : # Get User id results = r . table ( 'users' ) . get ( self . uid ) . update ( { 'acttype' : self . acttype , 'stripeid' : self . stripeid , 'stripe' : self . stripe , 'subscription' : self . subscription , 'subplans' : self . subplans } ) . run ( rdb ) if results : loginfo = { } loginfo [ 'type' ] = "setSubscription" loginfo [ 'uid' ] = self . uid loginfo [ 'acttype' ] = self . acttype loginfo [ 'subplans' ] = self . subplans loginfo [ 'subscription' ] = self . subscription loginfo [ 'time' ] = time . time ( ) logresult = r . table ( 'subscription_history' ) . insert ( loginfo ) . run ( rdb ) return True else : return False