コード例 #1
0
ファイル: views.py プロジェクト: HackTheHearst/HearstExplorer
def browse(request):
    client = CollectionSpaceClient(app_id='50090494',
                                   app_key='2080f7ee22be1e55783f8f9d8b631f82')
    json_data = client.fetch()
    artifacts = client.parse(json_data)

    template = loader.get_template('browseByImage/browse.html')
    context = RequestContext(request, {'data': artifacts})
    return HttpResponse(template.render(context))
コード例 #2
0
ファイル: views.py プロジェクト: HackTheHearst/HearstExplorer
def browse(request):
    client = CollectionSpaceClient(
        app_id='50090494',
        app_key='2080f7ee22be1e55783f8f9d8b631f82'
    )
    json_data = client.fetch()
    artifacts = client.parse(json_data)

    template = loader.get_template('browseByImage/browse.html')
    context = RequestContext(request, {
        'data': artifacts
    })
    return HttpResponse(template.render(context))
コード例 #3
0
ファイル: views.py プロジェクト: legatek/HearstExplorer
def browse(request):
    client = CollectionSpaceClient(
        app_id='/*appId goes here*/',
        app_key='/*appKey goes here*/'
    )
    json_data = client.fetch()
    artifacts = client.parse(json_data)

    template = loader.get_template('browseByImage/browse.html')
    context = RequestContext(request, {
        'data': artifacts
    })
    return HttpResponse(template.render(context))
コード例 #4
0
ファイル: views.py プロジェクト: HackTheHearst/HearstExplorer
def detail(request, artifact_id):
    client = CollectionSpaceClient(
        app_id='50090494',
        app_key='2080f7ee22be1e55783f8f9d8b631f82'
    )
    json_data = client.fetch_artifact(artifact_id)
    artifacts = client.parse(json_data)

    template = loader.get_template('browseByImage/detail.html')
    related_artifacts=client.parse(client.fetch_related(artifacts[0]))
    context = RequestContext(request, {
        'artifact': artifacts[0],
        'related_artifacts': related_artifacts
    })
    return HttpResponse(template.render(context))
コード例 #5
0
ファイル: views.py プロジェクト: legatek/HearstExplorer
def detail(request, artifact_id):
    client = CollectionSpaceClient(
        app_id='/*appId goes here*/',
        app_key='/*appKey goes here*/'
    )
    json_data = client.fetch_artifact(artifact_id)
    artifacts = client.parse(json_data)

    template = loader.get_template('browseByImage/detail.html')
    related_artifacts=client.parse(client.fetch_related(artifacts[0]))
    context = RequestContext(request, {
        'artifact': artifacts[0],
        'related_artifacts': related_artifacts
    })
    return HttpResponse(template.render(context))
コード例 #6
0
ファイル: views.py プロジェクト: HackTheHearst/HearstExplorer
def detail(request, artifact_id):
    client = CollectionSpaceClient(app_id='50090494',
                                   app_key='2080f7ee22be1e55783f8f9d8b631f82')
    json_data = client.fetch_artifact(artifact_id)
    artifacts = client.parse(json_data)

    template = loader.get_template('browseByImage/detail.html')
    related_artifacts = client.parse(client.fetch_related(artifacts[0]))
    context = RequestContext(request, {
        'artifact': artifacts[0],
        'related_artifacts': related_artifacts
    })
    return HttpResponse(template.render(context))