class Bootstrap3CodePlugin(CMSPlugin): """ CSS - Code: Model http://getbootstrap.com/css/#code """ CODE_TYPE_CHOICES = ( ('code', _('Inline')), ('kbd', _('User input')), ('pre', _('Basic block')), ('var', _('Variables')), ('samp', _('Sample output')), ) code_type = models.CharField( verbose_name=_('Code type'), choices=CODE_TYPE_CHOICES, default=CODE_TYPE_CHOICES[0][0], max_length=255, ) code = models.TextField( verbose_name=_('Code'), blank=True, ) classes = model_fields.Classes() attributes = AttributesField( verbose_name=_('Attributes'), blank=True, excluded_keys=['class'], ) cmsplugin_ptr = model_fields.CMSPluginField() def __str__(self): return '<{}>'.format(self.code_type)
class Task(models.Model): TASK_STATUS = ( ('on_hold', 'On Hold'), ('complete', 'Complete'), ('in_progress', 'In Progress'), ('to_do', 'To do'), ) task = models.CharField(max_length=250) author = models.ForeignKey(User, related_name='ToDoList') body = models.TextField() created = models.DateTimeField(auto_now_add=True) updated = models.DateTimeField(auto_now=True) status = models.CharField(max_length=20, choices=TASK_STATUS, default='to_do') class Meta: ordering = ('-created', ) def __str__(self): return self.task