1 from django.db import models
2 from django.utils.translation import ugettext_lazy as _
5 class Chunk(models.Model):
7 A Chunk is a piece of content associated with a unique key that can be inserted into
8 any template with the use of a special template tag.
10 key = models.CharField(_('key'), help_text=_('A unique name for this chunk of content'), primary_key=True, max_length=255)
11 description = models.CharField(_('description'), blank=True, max_length=255)
12 content = models.TextField(_('content'), blank=True)
16 verbose_name = _('chunk')
17 verbose_name_plural = _('chunks')
19 def __unicode__(self):
23 class Attachment(models.Model):
24 key = models.CharField(_('key'), help_text=_('A unique name for this attachment'), primary_key=True, max_length=255)
25 attachment = models.FileField(upload_to='chunks/attachment')
29 verbose_name, verbose_name_plural = _('attachment'), _('attachments')
31 def __unicode__(self):