public
Description: A personal journal application written in Django. You need this.
Homepage: http://trey.github.com/chiplog
Clone URL: git://github.com/trey/chiplog.git
Click here to lend your support to: chiplog and make a donation at www.pledgie.com !
chiplog / models.py
100644 28 lines (23 sloc) 0.751 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import datetime
from django.db import models
from django.db.models import permalink
from tagging.fields import TagField
import tagging
from django.utils.translation import ugettext_lazy as _
 
class Entry(models.Model):
    """
A Chiplog Entry
"""
    body = models.TextField(_('body'))
    created = models.DateTimeField(_('created'), auto_now_add=True)
    updated = models.DateTimeField( _('updated'), auto_now=True)
    tags = TagField()
    
    class Meta:
        verbose_name = _('entry')
        verbose_name_plural = _('entries')
        ordering = ['-created']
    
    def __unicode__(self):
        return self.body
    
    @models.permalink
    def get_absolute_url(self):
        return ('chiplog_detail', [str(self.id)])