26 lines
893 B
Python
26 lines
893 B
Python
from django.db import models
|
|
|
|
class PadmaText(models.Model):
|
|
published = models.BooleanField(default=False)
|
|
date = models.DateField(null=True)
|
|
title = models.CharField(max_length=512)
|
|
slug = models.SlugField()
|
|
author = models.CharField(max_length=512, blank=True)
|
|
author_bio = models.TextField(blank=True)
|
|
abstract = models.TextField(blank=True)
|
|
left_bar = models.TextField(blank=True)
|
|
view = models.CharField(max_length=128, choices=(('sidebar', 'Sidebar'),), default='sidebar')
|
|
html = models.TextField()
|
|
show_users = models.CharField(max_length=512, blank=True, help_text="Comma separated usernames")
|
|
show_layers = models.CharField(max_length=256, blank=True, help_text="Comma separated - for eg. transcript, description")
|
|
|
|
class Meta:
|
|
ordering = ['-date']
|
|
|
|
def __unicode__(self):
|
|
return self.title
|
|
|
|
def get_absolute_url(self):
|
|
return self.slug
|
|
|