Beispiel #1
0
 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
Beispiel #2
0
 def delete(self):
     db_session.delete(self)
     db_session.commit()
Beispiel #3
0
 def delete(self):
     if (len(self.entries)) > 0:
         return False
     db_session.delete(self)
     db_session.commit()
Beispiel #4
0
 def create(self):
     db_session.add(self)
     db_session.commit()
     return True