Skip to content

Instantly share code, notes, and snippets.

@mineta
Last active August 29, 2015 13:56
Show Gist options
  • Save mineta/9002054 to your computer and use it in GitHub Desktop.
Save mineta/9002054 to your computer and use it in GitHub Desktop.
# -*- 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