def remove_all(self): """ :return: """ mongo_conn = MongoConnection() upper_case_regex = r"/([A-Z]+\_[A-Z]+)/" for collection in MongoConnection.Collections.__dict__.keys(): if re.match(upper_case_regex, collection) is not None: coll = mongo_conn.get_collection(collection, create_if_not_found=False) if coll is not None: coll.remove({self.Meta.ID_KEY: self.visitor_id}) # remove all the data for the visitor
# We aren't declaring django models here, we will declare simple classes that will