2011-10-26 16:49:10 +00:00
|
|
|
from django.core.management.base import BaseCommand
|
|
|
|
from regluit.core.goodreads import GoodreadsClient
|
|
|
|
from regluit.core import tasks, bookloader
|
|
|
|
from django.conf import settings
|
|
|
|
from django.contrib.auth.models import User
|
2011-11-01 00:26:05 +00:00
|
|
|
|
|
|
|
#from regluit.core.goodreads import load_shelf_into_wishlist
|
|
|
|
from regluit.core import tasks
|
2011-10-26 16:49:10 +00:00
|
|
|
|
|
|
|
class Command(BaseCommand):
|
|
|
|
help = "list books on given user bookshelf"
|
|
|
|
args = "<user_name goodreads_user_id shelf_name max_books>"
|
|
|
|
|
|
|
|
def handle(self, user_name, goodreads_user_id, shelf_name, max_books, **options):
|
|
|
|
|
|
|
|
user = User.objects.get(username=user_name)
|
|
|
|
max_books = int(max_books)
|
|
|
|
|
2012-02-16 18:19:36 +00:00
|
|
|
tasks.load_goodreads_shelf_into_wishlist.delay(user.id, shelf_name, goodreads_user_id, max_books)
|