latest_change_time.py 371 Bytes
# -*- coding: utf-8 -*-

from django.core.management.base import BaseCommand

from history.models import HistoryFrame


class Command(BaseCommand):
    help = 'Prints the time of the latest recorded change.'

    def handle(self, **options):
        latest_frame = HistoryFrame.objects.latest('transaction_began')
        print latest_frame.transaction_began.isoformat()