def register_payeeid(self, payee_str): id = self.get_payeeid(payee_str) if id == None: payee = Payee.create(PAYEENAME=payee_str.strip(), CATEGID=-1, SUBCATEGID=-1) id = self.get_payeeid(payee_str) return id
def get_payee_name(self, payee_id): payee = Payee.select().where(Payee.PAYEEID == payee_id).get() return payee.PAYEENAME
def get_payeeid(self, payee_str): try: id = Payee.select().where(Payee.PAYEENAME == payee_str.strip()).get() return id.PAYEEID except peewee.DoesNotExist as e: return None