def check_valid_token(self, token): findBy = { 'token' : token, } result = Repository.filter_attribute(self.model, findBy).filter(self.model.expires_at > datetime.datetime.now()).first() return result
def deleteToken(self, token): return Repository.delete(self.model, {'token' : token})
def delete(self, findBy): result = Repository.delete(self.model, findBy) return result
def store(self, data): result = Repository.store(self.model, data) return result
def filter_attribute(self, findBy): result = Repository.filter_attribute(self.model, findBy).first() return result
def fetch_all(self): result = Repository.fetchAll(self.model) return result
def update(self, filterBy, data): result = Repository.update(self.model, filterBy, data) return result
def fetch_all_filter_attribute(self, findBy): result = Repository.filter_attribute(self.model, findBy).order_by( self.model.transaction_date.desc()).all() return result
def paginate_filter_attribute(self, filter_keys, item, page): return Repository.filer_by_paginated(self.model, filter_keys, item=item, page=page)