add poster management commands

This commit is contained in:
j 2010-08-11 15:10:29 +02:00
parent d0fa52041f
commit 12f04edd50
3 changed files with 20 additions and 0 deletions

View file

View file

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
import poster.models
class Command(BaseCommand):
"""
download all posters in PosterCache
"""
help = 'download all posters in PosterCache table.'
args = ''
def handle(self, **options):
for p in poster.models.PosterCache.objects.filter(image='', failed=False).order_by('-created'):
print p.created, p.url
p.get()