示例#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