def pay(user, service, value, cost): record = Record() record.date = date.today() record.user = user record.service = service record.value = value record.cost = cost record.save()
def _record(self, service, value, cost=0): record = Record() record.date = date.today() record.user = self.user record.service = service record.value = value record.cost = cost try: record.save() except RecordExists: pass