def interview(request, number): collection = Collection.objects.get(name='shenandoah-national-park') record = get_object_or_404(FieldValue, record__collection=collection, field__label='Identifier', value=number).record description = FieldValue.objects.filter(record=record, field__label='Description', ).values_list('value', flat=True) storages = filter_by_access(request.user, Storage) media = record.media_set.filter(storage__in=storages) images = filter(lambda m: m.mimetype == 'image/jpeg', media) atsviewer = audiotextsyncviewer(record, request) return render_to_response('snp-interview.html', {'record': record, 'description': description[0] if description else None, 'interview_number': number, 'has_audio_transcript': atsviewer, 'has_media': len(media) > 0, 'images': images, }, context_instance=RequestContext(request))
def interview(request, number): collection = Collection.objects.get(name='shenandoah-national-park') record = get_object_or_404(FieldValue, record__collection=collection, field__label='Identifier', value=number).record description = FieldValue.objects.filter( record=record, field__label='Description', ).values_list('value', flat=True) storages = filter_by_access(request.user, Storage) media = record.media_set.filter(storage__in=storages) images = filter(lambda m: m.mimetype == 'image/jpeg', media) atsviewer = audiotextsyncviewer(record, request) return render_to_response( 'snp-interview.html', { 'record': record, 'description': description[0] if description else None, 'interview_number': number, 'has_audio_transcript': atsviewer, 'has_media': len(media) > 0, 'images': images, }, context_instance=RequestContext(request))
def transcript(request, number): collection = Collection.objects.get(name='shenandoah-national-park') record = get_object_or_404(FieldValue, record__collection=collection, field__label='Identifier', value=number).record atsviewer = audiotextsyncviewer(record, request) return atsviewer.view(request, template='snp-transcript.html')