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