def handle(self, *args, **kwargs):
     q={"$and": [{"_deleted_at": {"$exists": True}}, {"_deleted_at": {"$ne": None }}]}
     cursor = xform_instances.find(q)
     c = 0
     for record in cursor:
         date_deleted = datetime_from_str(record[DELETEDAT])
         id = record[ID]
         if Instance.set_deleted_at(id, deleted_at=date_deleted):
             c += 1
         print "deleted on ", date_deleted
     print "-------------------------------"
     print "Updated %d records." % c
 def handle(self, *args, **kwargs):
     q={"$and": [{"_deleted_at": {"$exists": True}}, {"_deleted_at": {"$ne": None }}]}
     cursor = xform_instances.find(q)
     c = 0
     for record in cursor:
         date_deleted = datetime_from_str(record[DELETEDAT])
         id_string = record[XFORM_ID_STRING]
         uuid = record[UUID]
         username = record[USERFORM_ID].replace('_' + id_string, '')
         if Instance.delete_by_uuid(
                 username, id_string, uuid, deleted_at=date_deleted):
             c += 1
         print "deleted on ", date_deleted
     print "-------------------------------"
     print "Updated %d records." % c
 def handle(self, *args, **kwargs):
     q = {
         "$and": [{
             "_deleted_at": {
                 "$exists": True
             }
         }, {
             "_deleted_at": {
                 "$ne": None
             }
         }]
     }
     cursor = xform_instances.find(q)
     c = 0
     for record in cursor:
         date_deleted = datetime_from_str(record[DELETEDAT])
         id = record[ID]
         if Instance.set_deleted_at(id, deleted_at=date_deleted):
             c += 1
         print "deleted on ", date_deleted
     print "-------------------------------"
     print "Updated %d records." % c