Beispiel #1
0
def get_counter_ids(group_id):
    '''
    Fetch all the Counter instances of the exporting Group
    '''
    counter_collection_cur = counter_collection.find({'group_id':ObjectId(group_id)})
    if counter_collection_cur :
        for each_obj in counter_collection_cur :
            dump_node(node=each_obj,collection_name=counter_collection)
Beispiel #2
0
def get_counter_ids(group_id):
    '''
    Fetch all the Counter instances of the exporting Group
    '''
    counter_collection_cur = counter_collection.find({'group_id':ObjectId(group_id)})
    if counter_collection_cur :
        for each_obj in counter_collection_cur :
            dump_node(node=each_obj,collection_name=counter_collection)
Beispiel #3
0
def get_counter_ids(group_id=None, group_node=None, user_ids=None):
    '''
    Fetch all the Counter instances of the exporting Group
    '''
    if group_id:
        counter_collection_cur = counter_collection.find(
            {'group_id': ObjectId(group_id)})
    elif group_node:
        counter_collection_cur = counter_collection.find(
            {'group_id': ObjectId(group_node._id)})
    elif user_ids:
        counter_collection_cur = counter_collection.find(
            {'user_id': {
                '$in': user_ids
            }})

    if counter_collection_cur:
        for each_obj in counter_collection_cur:
            dump_node(node=each_obj,
                      collection_name=counter_collection,
                      variables_dict=GLOBAL_DICT)
Beispiel #4
0
def get_counter_data(user_ids=None):
    '''
    Fetch all the Counter instances of the exporting Group
    '''
    counter_collection_cur = counter_collection.find({
        'user_id': {
            '$in': user_ids
        },
        'group_id': {
            '$in': UNIT_IDS
        }
    })
    return counter_collection_cur
Beispiel #5
0
from gnowsys_ndf.ndf.models import  counter_collection,Author
from django.core.management import execute_from_command_line

usernames_list = Author.get_author_usernames_list_from_user_id_list((counter_collection.find().distinct("user_id")))
for each in usernames_list:
	execute_from_command_line(["manage.py", "activity_timestamp",each])