Commit 3b78c1f3 authored by Jean Michel Rouly's avatar Jean Michel Rouly
Browse files

Added template filter to grab worldcat ISBN data on a textbook.

parent 3c5d6abc
{% extends 'layouts/base.html' %}
{% load website_extras %}
{% block title %}
GMU Bookshare • Seller Profile
......@@ -151,7 +152,7 @@ function insert_target( source, target ){
{% for lookout in lookouts %}
<tr>
<td class="text-center">{{lookout.ISBN}}</td>
<td>{{lookout.get_info.title}}</td>
<td>{{lookout.ISBN|get_isbn_data:"title"}}</td>
<td class="text-center">
<a href="#" onclick="insert_target('{{DeleteLookout_form.lookout_id.id_for_label}}', '{{ lookout.pk }}');"
data-toggle="modal" data-target="#DeleteLookout">Delete</a>
......
from django import template
from website.views import ISBNMetadata
register = template.Library()
@register.filter
def get_isbn_data( isbn, field ):
data = ISBNMetadata( isbn )
if data:
return data.get(field)
else:
return "No data found."
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment