def create(self): # TODO: move this out of here and find out how to do custom # getters and setters with SQLAlchemy if not self.entry_type in EntryType.all(): raise Exception('Invalid EntryType') return False db_session.add(self) db_session.commit() return True
def delete(self): db_session.delete(self) db_session.commit()
def delete(self): if (len(self.entries)) > 0: return False db_session.delete(self) db_session.commit()
def create(self): db_session.add(self) db_session.commit() return True