Beispiel #1
0
 def updateStatusSended(cls,id):
     
     try:
         #sql = "update sur_send_mail set status= 'F', sended_date='" + str(datetime.now()) + "' where id_send_mail = " + str(id);
         #result = DBSession.execute(sql);
         #DBSession.flush() ;            
         #DBSession.execute("UNLOCK TABLES");
         #email = DBSession.query(cls).filter(cls.id_send_mail == id).first();
         #email.status = 'F';
         
         DBSession.query(cls).filter(cls.id_send_mail == id).update({"status": 'F',"sended_date" : datetime.now() }) ;
         DBSession.flush() ;
         
         return True, 'success';
     except Exception as  e:
         print "Exception----------> : "
         print e;  
         return False, 'Cannot delete.';#e.__str__();
Beispiel #2
0
 def save (self):
     DBSession.add(self); 
     DBSession.flush() ;
Beispiel #3
0
 def deleteById(cls,id):
     result = DBSession.query(cls).filter(cls.id_user_social_network == id).delete()
     DBSession.flush()
     return result
Beispiel #4
0
 def updateGroupUserCreator(self):
     result = DBSession.execute('insert into tg_user_group values(:user_id,:group_id)', {'user_id': self.user_id,'group_id':4})
     DBSession.flush() ;
Beispiel #5
0
 def updateGroupUserVoter(self):
    
     result = DBSession.execute('insert into tg_user_group values(:user_id,:group_id)', {'user_id': self.user_id,'group_id':2})
     #DBSession.execute(s, user_id= self.user_id ).fetchall() 
     DBSession.flush() ;
Beispiel #6
0
 def updateStatus(self):
     self.status = 'F'
     self.sended_date = datetime.now() 
     DBSession.flush() ;