Make marc records accessible from work page

pull/1/head
eric 2013-07-29 15:57:33 -04:00
parent 1307ae7091
commit 8576a7fb7b
2 changed files with 17 additions and 6 deletions

View File

@ -378,9 +378,13 @@
<a href="{% url new_edition work_id edition.id %}">Edit this edition</a><br />
{% endif %}
{% if edition.googlebooks_id %}
See <a href="https://encrypted.google.com/books?id={{ edition.googlebooks_id }}">this edition on Google Books</a>
See <a href="https://encrypted.google.com/books?id={{ edition.googlebooks_id }}">this edition on Google Books</a><br />
{% endif %}
{% for record in edition.MARCrecords.all %}
Download {{record.link_target}} MARC record for this edition: (<a href="{% url marc_concatenate %}?record_{{ record.id }}=on&amp;format=xml">XML</a>) (<a href="{% url marc_concatenate %}?record_{{ record.id }}=on&amp;format=mrc">mrc</a>)<br />
{% endfor %}
</div>
</div>
{% if edition.ebook_form %}
{% ifnotequal status 'ACTIVE' %}

View File

@ -2672,7 +2672,6 @@ class MARCConfigView(FormView):
else:
return super(MARCConfigView, self).form_valid(form)
@require_POST
def marc_concatenate(request):
"""
options for future work...
@ -2680,12 +2679,20 @@ def marc_concatenate(request):
dispatch as background process, email when done?
if not caching, delete files on s3 after a while?
make the control flow suck less during file write
"""
format = request.POST['format']
# extract the user-selected records from the POST QueryDict
Can be used as a GET URL
"""
if request.method == 'POST':
params=request.POST
elif request.method == 'GET':
params=request.GET
else:
return HttpResponseNotFound
format = params['format']
# extract the user-selected records from the params QueryDict
selected_records = list(
k for k in request.POST if request.POST[k] == u'on'
k for k in params if params[k] == u'on'
)
if not selected_records:
messages.error(