Beispiel #1
0
 def delete (self, context):
     cursor = context.get_cursor();
     try:
         # First delete all sets to which this record was assigned
         cursor.execute("""
             DELETE FROM user_set_records
             WHERE record_id = %s
             """, self.record_id)
         
         # Then delete the record itself
         DTable.delete(self, context)
         if context.config.use_cache:
             context.cache_delete('%s:%s' % (self.CACHE_KEY, self.uid))
     except Exception, e:
         context.logger.error(e)
Beispiel #2
0
    def delete(self, context):
        cursor = context.get_cursor()
        try:
            # First delete all sets to which this record was assigned
            cursor.execute(
                """
                DELETE FROM user_set_records
                WHERE record_id = %s
                """, self.record_id)

            # Then delete the record itself
            DTable.delete(self, context)
            if context.config.use_cache:
                context.cache_delete('%s:%s' % (self.CACHE_KEY, self.uid))
        except Exception, e:
            context.logger.error(e)
Beispiel #3
0
 def delete (self, context):
     cursor = context.get_cursor()
     try:
         # First delete all records assigned to this set
         cursor.execute("""
             DELETE FROM user_set_records
             WHERE user_set_id = %s
             """, self.uid)
         
         # Then remove the set
         delete_phrase = 'DELETE FROM %s' % self.TABLE_NAME
         cursor.execute(delete_phrase + """
             WHERE uid = %s
             """, self.uid)
         DTable.delete(self, context)
         if context.config.use_cache:
             context.cache_delete('%s:%s' % (self.CACHE_KEY, self.uid))
     except Exception, e:
         context.logger.error(e)
Beispiel #4
0
    def delete(self, context):
        cursor = context.get_cursor()
        try:
            # First delete all records assigned to this set
            cursor.execute(
                """
                DELETE FROM user_set_records
                WHERE user_set_id = %s
                """, self.uid)

            # Then remove the set
            delete_phrase = 'DELETE FROM %s' % self.TABLE_NAME
            cursor.execute(
                delete_phrase + """
                WHERE uid = %s
                """, self.uid)
            DTable.delete(self, context)
            if context.config.use_cache:
                context.cache_delete('%s:%s' % (self.CACHE_KEY, self.uid))
        except Exception, e:
            context.logger.error(e)