From e91a794d42baf35d7d4824391ddf3f54a0094491 Mon Sep 17 00:00:00 2001 From: Raymond Yee Date: Wed, 14 Sep 2011 08:40:42 -0700 Subject: [PATCH] Forgot to add a few new files to previous commit. --- api/templates/isbn.html | 56 +++++++++++++++++++++++ core/management/commands/list_editions.py | 11 +++++ 2 files changed, 67 insertions(+) create mode 100644 api/templates/isbn.html create mode 100644 core/management/commands/list_editions.py diff --git a/api/templates/isbn.html b/api/templates/isbn.html new file mode 100644 index 00000000..65235e97 --- /dev/null +++ b/api/templates/isbn.html @@ -0,0 +1,56 @@ + + + + isbn + + + + +

You entered isbn: {{isbn}}

+ + + + {% if editions %} + + {% else %} +

No editions are available.

+ {% endif %} + + + + + diff --git a/core/management/commands/list_editions.py b/core/management/commands/list_editions.py new file mode 100644 index 00000000..f7ddb8f2 --- /dev/null +++ b/core/management/commands/list_editions.py @@ -0,0 +1,11 @@ +from django.core.management.base import BaseCommand + +from regluit.core import models + +class Command(BaseCommand): + help = "list all editions in the database" + + def handle(self, *args, **options): + editions = models.Edition.objects.all() + for edition in editions: + print edition.id, edition.title