Esempio n. 1
0
 def delete(self):
     """
     Deletes the current instance
     """
     obj = session.delete(self)
     session.commit()
     return obj
Esempio n. 2
0
 def update(self, *args, **kwargs):
     """
     Updates direct against the database
     """
     obj = session.update(self, *args, **kwargs)
     session.commit()
     return obj
Esempio n. 3
0
 def delete(self):
     """
     Deletes the current instance
     """
     obj = session.delete(self)
     session.commit()
     return obj
Esempio n. 4
0
 def update(self, *args, **kwargs):
     """
     Updates direct against the database
     """
     obj = session.update(self, *args, **kwargs)
     session.commit()
     return obj
Esempio 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
Esempio 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