mirror of
https://github.com/scrapy/scrapy.git
synced 2025-02-28 23:58:00 +00:00
* Article This is a simple "article" application with ReST support. Instances could be marked as "main" and a templatetag retrieve them. * Blog Django blog application, needs a better integration yet. * Download Little application to manage "download" links * Link Little application to manage links (like those displayed on top and in the footer) --HG-- extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%403
26 lines
757 B
Python
26 lines
757 B
Python
import datetime
|
|
from django.db import models
|
|
|
|
|
|
class Entry(models.Model):
|
|
pub_date = models.DateTimeField()
|
|
slug = models.SlugField(unique_for_date='pub_date')
|
|
headline = models.CharField(max_length=200)
|
|
summary = models.TextField(help_text="Use raw HTML.")
|
|
body = models.TextField(help_text="Use raw HTML.")
|
|
author = models.CharField(max_length=100)
|
|
|
|
class Meta:
|
|
verbose_name_plural = 'entries'
|
|
ordering = ('-pub_date',)
|
|
get_latest_by = 'pub_date'
|
|
|
|
class Admin:
|
|
list_display = ('pub_date', 'headline', 'author')
|
|
|
|
def __unicode__(self):
|
|
return self.headline
|
|
|
|
def get_absolute_url(self):
|
|
return "/weblog/%s/%s/" % (self.pub_date.strftime("%Y/%b/%d").lower(), self.slug)
|