Ejemplo n.º 1
0
 def delete(self):
     """
     Deletes the current instance
     """
     obj = session.delete(self)
     session.commit()
     return obj
Ejemplo n.º 2
0
 def update(self, *args, **kwargs):
     """
     Updates direct against the database
     """
     obj = session.update(self, *args, **kwargs)
     session.commit()
     return obj
Ejemplo n.º 3
0
 def delete(self):
     """
     Deletes the current instance
     """
     obj = session.delete(self)
     session.commit()
     return obj
Ejemplo n.º 4
0
 def update(self, *args, **kwargs):
     """
     Updates direct against the database
     """
     obj = session.update(self, *args, **kwargs)
     session.commit()
     return obj
Ejemplo n.º 5
0
 def save(self):
     """
     Save the current instance. We force a flush so it mimics Django's
     behavior.
     """
     if self.pk is None:
         obj = session.save(self)
         session.commit()
     else:
         obj = self.update()
     return obj
Ejemplo n.º 6
0
 def save(self):
     """
     Save the current instance. We force a flush so it mimics Django's
     behavior.
     """
     if self.pk is None:
         obj = session.save(self)
         session.commit()
     else:
         obj = self.update()
     return obj