# -*- coding: utf-8 -*-
from django.conf import settings
from django.core.management.base import BaseCommand
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
from django.db.models import Q
from libra.books.models import *
from django_intranet_stuff.models import Staff, City, Office

class Command(BaseCommand):
    help = u'Re-save all books entries'
    
    def handle(self, *args, **options):
        books = Book.objects.all()
        for book in books:
            book.update_related_fields()
        print 'resaving done'