add poster management commands
This commit is contained in:
parent
d0fa52041f
commit
12f04edd50
3 changed files with 20 additions and 0 deletions
0
oxdata/poster/management/__init__.py
Normal file
0
oxdata/poster/management/__init__.py
Normal file
0
oxdata/poster/management/commands/__init__.py
Normal file
0
oxdata/poster/management/commands/__init__.py
Normal file
20
oxdata/poster/management/commands/cache_poster.py
Normal file
20
oxdata/poster/management/commands/cache_poster.py
Normal 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()
|
||||||
|
|
Loading…
Reference in a new issue