2015-07-18 07:09:17 +00:00
|
|
|
from __future__ import unicode_literals
|
2012-07-10 22:18:48 +00:00
|
|
|
from django.db import models
|
|
|
|
from django.contrib.auth.models import User
|
2015-07-18 07:09:17 +00:00
|
|
|
from django.utils.encoding import python_2_unicode_compatible
|
2012-07-10 22:18:48 +00:00
|
|
|
|
2012-07-18 23:19:59 +00:00
|
|
|
import reversion
|
|
|
|
|
2012-07-10 22:18:48 +00:00
|
|
|
from markitup.fields import MarkupField
|
|
|
|
|
|
|
|
|
2015-07-18 07:09:17 +00:00
|
|
|
@python_2_unicode_compatible
|
2012-07-10 22:18:48 +00:00
|
|
|
class Box(models.Model):
|
2014-01-13 21:49:40 +00:00
|
|
|
|
2012-07-10 22:18:48 +00:00
|
|
|
label = models.CharField(max_length=100, db_index=True)
|
|
|
|
content = MarkupField(blank=True)
|
2014-01-13 21:49:40 +00:00
|
|
|
|
2012-07-10 22:18:48 +00:00
|
|
|
created_by = models.ForeignKey(User, related_name="boxes")
|
|
|
|
last_updated_by = models.ForeignKey(User, related_name="updated_boxes")
|
2014-01-13 21:49:40 +00:00
|
|
|
|
2015-07-18 07:09:17 +00:00
|
|
|
def __str__(self):
|
2012-07-10 22:18:48 +00:00
|
|
|
return self.label
|
2014-01-13 21:49:40 +00:00
|
|
|
|
2012-07-10 22:18:48 +00:00
|
|
|
class Meta:
|
|
|
|
verbose_name_plural = "boxes"
|
2012-07-18 23:19:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
reversion.register(Box)
|