Last active
August 29, 2015 13:56
-
-
Save mineta/9002054 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from django.db import models | |
from django.utils.translation import ugettext_lazy as _ | |
import jsonfield | |
class TaskHistory(models.Model): | |
# Relations | |
# Attributes - mandatory | |
name = models.CharField( | |
max_length=100, | |
verbose_name=_("Task name"), | |
help_text=_("Select a task to record"), | |
) | |
# Attributes - optional | |
history = jsonfield.JSONField( | |
default={}, | |
verbose_name=_("history"), | |
help_text=_("JSON containing the tasks history") | |
) | |
# Manager | |
# Functions | |
# Meta & unicode | |
class Meta: | |
verbose_name = _('Task History') | |
verbose_name_plural = _('Task Histories') | |
def __unicode__(self): | |
return _("Task History of Task: %s") % self.name | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment