from django.db import models

from idm.core.querysets.commandtimestamp import CommandTimestampManager


class CommandTimestamp(models.Model):
    command = models.TextField()
    last_success_start = models.DateTimeField()
    last_success_finish = models.DateTimeField()

    objects = CommandTimestampManager()

    def __str__(self):
        return 'Command {} last_success_start: {}'.format(self.command, self.last_success_start)
