Skip to content

Instantly share code, notes, and snippets.

@guillaumepiot
Created August 9, 2013 10:09
Show Gist options
  • Save guillaumepiot/6192596 to your computer and use it in GitHub Desktop.
Save guillaumepiot/6192596 to your computer and use it in GitHub Desktop.
CMSBase - Testimonials model
from django.db import models
from django.utils.translation import ugettext_lazy as _
from cmsbase.models import Page
class Testimonial(models.Model):
content = models.TextField(max_length=500)
author = models.CharField(max_length=100, blank=True, null=True)
related_to = models.ManyToManyField(Page, blank=True, null=True)
publish = models.BooleanField()
created_date = models.DateTimeField(auto_now_add=True)
updated_date = models.DateTimeField(auto_now=True)
class Meta:
verbose_name=_('Testimonial')
verbose_name_plural=_('Testimonials')
def __unicode__(self):
return u"%s" % self.content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment