def get_total_resources_count(self):

        # print "\n get_total_resources_count === "
        self.all_res_nodes = []
        self.all_res_nodes = dig_nodes_field(self.group_obj, 'collection_set',
                                             True, ['Page', 'File'],
                                             self.all_res_nodes)

        return len(self.all_res_nodes)
	def get_total_resources_count(self):


		# print "\n get_total_resources_count === "
		self.all_res_nodes = []
		self.all_res_nodes = dig_nodes_field(self.group_obj,'collection_set',True,['Page','File'],self.all_res_nodes)



		return len(self.all_res_nodes)
	def get_total_resources_count(self):
		t0 = time.time()

		# print "\n get_total_resources_count === "
		self.all_res_nodes = []
		self.all_res_nodes = dig_nodes_field(self.group_obj,'collection_set',True,['Page','File'],self.all_res_nodes)
		t1 = time.time()
		time_diff = t1 - t0
		# print "\n get_total_resources_count == ", time_diff

		return len(self.all_res_nodes)
Exemple #4
0
    def get_total_resources_count(self):
        t0 = time.time()

        # print "\n get_total_resources_count === "
        self.all_res_nodes = []
        self.all_res_nodes = dig_nodes_field(self.group_obj, 'collection_set',
                                             True, ['Page', 'File'],
                                             self.all_res_nodes)
        t1 = time.time()
        time_diff = t1 - t0
        # print "\n get_total_resources_count == ", time_diff

        return len(self.all_res_nodes)
Exemple #5
0
    home_grp_id = node_collection.one({'_type': 'Group', 'name': 'home'})._id
    create_gattribute(home_grp_id, 'items_sort_list', module_obj_list)
except Exception as module_sort_order_ids_err:
    pass
    print "\nError in module_sort_order_ids. ", module_sort_order_ids_err
units_cur = node_collection.find({
    '_type': 'Group',
    '_id': {
        '$in': units_for_renaming_leaf_nodes
    }
})
for each_unit in units_cur:
    try:
        if each_unit:
            print "\nUnit: ", each_unit.name
            all_leaf_node_ids = dig_nodes_field(parent_node=each_unit,
                                                only_leaf_nodes=True)
            all_leaf_node_cur = node_collection.find(
                {'_id': {
                    '$in': all_leaf_node_ids
                }})
            print "\nLeaf nodes found: ", all_leaf_node_cur.count()
            for each_node in all_leaf_node_cur:
                name_val = each_node.name
                if name_val != each_node.altnames:
                    each_node.altnames = name_val  # Unique name --> Display name
                    each_node.save()
                    try:
                        print "\n ", each_node.altnames, " --->", each_node.name
                    except Exception as e:
                        pass
        else:
Exemple #6
0
                module_obj_list.append(each_node)
        except Exception as modulde_not_found_err:
            print "\nError in module_not_found for each_id: ", each_id, "\nError: ", modulde_not_found_err
            pass
    print "\nTotal modules: ", len(module_obj_list)
    home_grp_id = node_collection.one({'_type': 'Group', 'name': 'home'})._id
    create_gattribute(home_grp_id, 'items_sort_list', module_obj_list)
except Exception as module_sort_order_ids_err:
    pass
    print "\nError in module_sort_order_ids. ", module_sort_order_ids_err
units_cur = node_collection.find({'_type': 'Group', '_id': {'$in': units_for_renaming_leaf_nodes}})
for each_unit in units_cur:
    try:
        if each_unit:
            print "\nUnit: ", each_unit.name
            all_leaf_node_ids = dig_nodes_field(parent_node=each_unit, only_leaf_nodes=True)
            all_leaf_node_cur = node_collection.find({'_id': {'$in': all_leaf_node_ids}})
            print "\nLeaf nodes found: ", all_leaf_node_cur.count()
            for each_node in all_leaf_node_cur:
                name_val = each_node.name
                if name_val != each_node.altnames:
                    each_node.altnames = name_val # Unique name --> Display name
                    each_node.save()
                    try:
                        print "\n ", each_node.altnames , " --->", each_node.name
                    except Exception as e:
                        pass
        else:
            print "\nNo Group found!!"
    except Exception as units_for_renaming_leaf_nodes_err:
        pass