aboutsummaryrefslogtreecommitdiffstats
path: root/apps/docs
diff options
context:
space:
mode:
authorFilipp Lepalaan <f@230.to>2013-11-17 19:15:30 +0200
committerFilipp Lepalaan <f@230.to>2013-11-17 19:15:30 +0200
commit297419f370ea87458017ee506a2e551e9068b66b (patch)
tree429d3e1b6c7f2facfb3e361b4b708f0d36e8aac8 /apps/docs
parentf077badf3163fc36c111dc45fe8d7d6f57d8712a (diff)
downloadmotor.old-297419f370ea87458017ee506a2e551e9068b66b.tar.gz
motor.old-297419f370ea87458017ee506a2e551e9068b66b.tar.bz2
motor.old-297419f370ea87458017ee506a2e551e9068b66b.zip
Swicthing machines
Diffstat (limited to 'apps/docs')
-rw-r--r--apps/docs/models.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/docs/models.py b/apps/docs/models.py
index bd95207..f95da57 100644
--- a/apps/docs/models.py
+++ b/apps/docs/models.py
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-
from django.db import models
from django.template.defaultfilters import slugify
@@ -11,17 +9,20 @@ class Image(models.Model):
class Article(models.Model):
slug = models.SlugField(editable=False)
- title = models.CharField(max_length=255)
- content = models.TextField()
+ title = models.CharField(max_length=255, default='New Article')
+ content = models.TextField(default='')
published = models.BooleanField(default=True)
created_at = models.DateTimeField(auto_now=True)
updated_at = models.DateTimeField(auto_now=True)
- images = models.ManyToManyField(Image, null=True)
+ images = models.ManyToManyField(Image, null=True, editable=False)
def __unicode__(self):
return self.title
+ def get_absolute_url(self):
+ return '/manage/docs/%d/' % self.pk
+
def save(self, *args, **kwargs):
self.slug = slugify(self.title)
super(Article, self).save(*args, **kwargs)