kimkyuseok / study_git

study_git
0 stars 0 forks source link

shotgrid 로그 받아내기 #42

Open kimkyuseok opened 6 months ago

kimkyuseok commented 6 months ago
# 프로젝트 이름
project_name = "moe"
# project_name = "fsh"
#project_name = "mhj"
#project_name = "mhj4"
csv_file_path = r"d:/test.csv"

# ShotGrid에서 프로젝트 정보 가져오기
project = sg.find_one("Project", [["name", "is", project_name]])
print(project)
if project:
    project_id = project['id']
    filters = [
        ['event_type','is','Summary'],
    ]
    fields = [
        "id",
        "event_type",
        "attribute_name",
        "meta",
        "entity",
        "user",
        "project",
        "session_uuid",
        "created_at",
    ]
    #fields = ['summary','created_at']
    #order=[{'field_name':'created_at','direction':'desc'}]
    order = [{"column": "id", "direction": "asc"}]
    EventLogEntryA = sg.find("EventLogEntry",filters,fields,order,limit=10)
    print(EventLogEntryA)
kimkyuseok commented 6 months ago
# 프로젝트 이름
project_name = "moe"

# ShotGrid에서 프로젝트 정보 가져오기
project = sg.find_one("Project", [["name", "is", project_name]])
if project:
    project_id = project['id']
    filters = [
        #['event_type', 'is', 'Summary'],
        ['project', 'is', {'type': 'Project', 'id': project_id}]
    ]
    fields = [
        "id",
        "event_type",
        "attribute_name",
        "meta",
        "entity",
        "user",
        "project",
        "session_uuid",
        "created_at",
    ]
    #order = [{"column": "id", "direction": "asc"}]
    order = [{"column": "id", "direction": "desc"}]
    EventLogEntryA = sg.find("EventLogEntry", filters, fields, order, limit=10)
    for i in EventLogEntryA:
        print(i)
else:
    print("Project not found:", project_name)
kimkyuseok commented 6 months ago
# 프로젝트 이름
project_name = "moe"

# ShotGrid에서 프로젝트 정보 가져오기
project = sg.find_one("Project", [["name", "is", project_name]])
if project:
    project_id = project['id']

    # 필터에 사용할 유저 정보 찾기
    user = sg.find_one("HumanUser", [["name", "is", "김혜강"]])
    if user:
        user_id = user['id']

        filters = [
            #['event_type', 'is', 'Summary'],
            ['project', 'is', {'type': 'Project', 'id': project_id}],
            ['user', 'is', {'type': 'HumanUser', 'id': user_id}]
        ]
        fields = [
            "id",
            "event_type",
            "attribute_name",
            "meta",
            "entity",
            "user",
            "project",
            "session_uuid",
            "created_at",
        ]
        order = [{"column": "id", "direction": "desc"}]
        EventLogEntryA = sg.find("EventLogEntry", filters, fields, order, limit=10)
        for event in EventLogEntryA:
            print(event)
    else:
        print("User not found: 김혜강")
else:
    print("Project not found:", project_name)