Skip to content

Instantly share code, notes, and snippets.

@gowram
Created October 30, 2014 05:59
Show Gist options
  • Save gowram/794294e2c037f17fe638 to your computer and use it in GitHub Desktop.
Save gowram/794294e2c037f17fe638 to your computer and use it in GitHub Desktop.
from django.db import models
from parler.models import TranslatableModel, TranslatedFields
from django.utils.translation import ugettext as _
# Create your models here.
class MyQuiz(TranslatableModel):
translations = TranslatedFields(
title=models.CharField(
_('Title'), max_length=250, default=True, unique=True
),
description=models.CharField(
_('Description'), max_length=255, blank=True
),
comments=models.CharField(
_('Comments'), max_length=255, blank=True
),
icon=models.ImageField(
_("Icons"), upload_to='static/icons', blank=True
),
)
def __unicode__(self):
return self.title
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment