Guilherme Gondim avatar Guilherme Gondim committed 5f9af51 Merge

Merged up

Comments (0)

Files changed (15)

 class EntryAdmin(admin.ModelAdmin):
     form = EntryForm
     date_hierarchy = 'time_created'
+    list_select_related = True
     fieldsets = (
         (None, {
-            'fields': (('title', 'highlight'), 'status', 'categories', 'tags',
-                       'image', 'body')
+            'fields': (('title', 'highlight'), 'status')
+        }),
+        (_('Content'), {
+            'fields': ('image', 'body'),
+        }),
+        (_('Archive'), {
+            'fields': ('categories', 'tags'),
+        }),
+        (_('Discussion'), {
+            'fields': ('allow_comments',),
         }),
         (_('Advanced'), {
-            'classes': ('collapse',),
-            'fields': ('slug', 'allow_comments'),
+            'fields': ('slug',),
         })
     )
-    list_display = ('title', 'status_', 'user', 'categories_', 'date')
+    list_display = ('title', 'fancy_status', 'user', 'categories_', 'date')
     list_filter = ('status', 'highlight', 'categories', 'time_published',
                    'time_modified', 'allow_comments', 'user')
     prepopulated_fields = {'slug': ('title',)}
     date.admin_order_field = 'time_created'
     date.short_description = _('date')
 
-    def status_(self, obj):
-        html = '<strong>{}</strong><br /><small>{}</small>'
-        date = obj.time_published if obj.is_visible() else obj.time_modified
-        fmt_date = formats.date_format(date, 'SHORT_DATETIME_FORMAT')
-        if obj.is_visible() and obj.highlight:
-            status = _('Highlighted')
-        else:
-            status = obj.get_status_display()
-        return html.format(status, fmt_date)
-    status_.admin_order_field = 'status'
-    status_.allow_tags = True
-    status_.short_description = _('status')
-
     def categories_(self, obj):
         category_names = obj.categories.values_list('name', flat=True)
         if category_names:
Add a comment to this file

diario/locale/en/LC_MESSAGES/django.mo

Binary file modified.

diario/locale/en/LC_MESSAGES/django.po

 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-09-17 18:13-0300\n"
+"POT-Creation-Date: 2013-09-23 17:10-0300\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: admin.py:23
+#: admin.py:22
+msgid "Content"
+msgstr ""
+
+#: admin.py:25
+msgid "Archive"
+msgstr ""
+
+#: admin.py:28
+msgid "Discussion"
+msgstr ""
+
+#: admin.py:31
 msgid "Advanced"
 msgstr ""
 
-#: admin.py:38
+#: admin.py:45
 msgid "date"
 msgstr ""
 
-#: admin.py:45
+#: admin.py:52
 msgid "Highlighted"
 msgstr ""
 
-#: admin.py:51 models.py:75
+#: admin.py:58 models.py:87
 msgid "status"
 msgstr ""
 
-#: admin.py:59 models.py:58 models.py:106
+#: admin.py:66 models.py:66 models.py:124
 msgid "categories"
 msgstr ""
 
-#: admin.py:67 models.py:110
+#: admin.py:74 models.py:128
 msgid "tags"
 msgstr ""
 
 msgid "Last modified at {}"
 msgstr ""
 
-#: models.py:17
+#: models.py:20
 msgid ""
-"Automatically built from the title. A slug is a short label generally used "
-"in URLs."
+"Automatically built from the title. A slug is a label generally used in URLs."
 msgstr ""
 
-#: models.py:52
+#: models.py:56
 msgid "name"
 msgstr ""
 
-#: models.py:53 models.py:81
+#: models.py:58 models.py:94
 msgid "slug"
 msgstr ""
 
-#: models.py:57
+#: models.py:65
 msgid "category"
 msgstr ""
 
-#: models.py:80
+#: models.py:92
 msgid "title"
 msgstr ""
 
-#: models.py:82
+#: models.py:98
 msgid "highlight"
 msgstr ""
 
-#: models.py:84
+#: models.py:100
 msgid "featured image"
 msgstr ""
 
-#: models.py:88
+#: models.py:104
 msgid "body"
 msgstr ""
 
-#: models.py:90
+#: models.py:106
 msgid "allow comments"
 msgstr ""
 
-#: models.py:96
+#: models.py:112
 msgid "user"
 msgstr ""
 
-#: models.py:98
+#: models.py:116
 msgid "creation time"
 msgstr ""
 
-#: models.py:99
+#: models.py:117
 msgid "modification time"
 msgstr ""
 
-#: models.py:101
+#: models.py:119
 msgid "publication time"
 msgstr ""
 
-#: models.py:117
+#: models.py:135
 msgid "entry"
 msgstr ""
 
-#: models.py:118
+#: models.py:136
 msgid "entries"
 msgstr ""
Add a comment to this file

diario/locale/es/LC_MESSAGES/django.mo

Binary file modified.

diario/locale/es/LC_MESSAGES/django.po

 msgstr ""
 "Project-Id-Version: Django Diário\n"
 "Report-Msgid-Bugs-To: https://bitbucket.org/semente/django-diario/issues\n"
-"POT-Creation-Date: 2013-09-17 18:13-0300\n"
-"PO-Revision-Date: 2013-09-17 21:13+0000\n"
+"POT-Creation-Date: 2013-09-23 17:10-0300\n"
+"PO-Revision-Date: 2013-09-23 20:11+0000\n"
 "Last-Translator: Guilherme Gondim <semente@taurinus.org>\n"
 "Language-Team: Spanish (http://www.transifex.com/projects/p/django-diario/language/es/)\n"
 "MIME-Version: 1.0\n"
 "Language: es\n"
 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
 
-#: admin.py:23
+#: admin.py:22
+msgid "Content"
+msgstr ""
+
+#: admin.py:25
+msgid "Archive"
+msgstr ""
+
+#: admin.py:28
+msgid "Discussion"
+msgstr ""
+
+#: admin.py:31
 msgid "Advanced"
 msgstr ""
 
-#: admin.py:38
+#: admin.py:45
 msgid "date"
 msgstr ""
 
-#: admin.py:45
+#: admin.py:52
 msgid "Highlighted"
 msgstr ""
 
-#: admin.py:51 models.py:75
+#: admin.py:58 models.py:87
 msgid "status"
 msgstr ""
 
-#: admin.py:59 models.py:58 models.py:106
+#: admin.py:66 models.py:66 models.py:124
 msgid "categories"
 msgstr ""
 
-#: admin.py:67 models.py:110
+#: admin.py:74 models.py:128
 msgid "tags"
 msgstr ""
 
 msgid "Last modified at {}"
 msgstr ""
 
-#: models.py:17
+#: models.py:20
 msgid ""
-"Automatically built from the title. A slug is a short label generally used "
-"in URLs."
-msgstr "Construido automaticamente a partir del título. Un slug es una etiqueta usada en URLs."
+"Automatically built from the title. A slug is a label generally used in "
+"URLs."
+msgstr ""
 
-#: models.py:52
+#: models.py:56
 msgid "name"
 msgstr ""
 
-#: models.py:53 models.py:81
+#: models.py:58 models.py:94
 msgid "slug"
 msgstr "slug"
 
-#: models.py:57
+#: models.py:65
 msgid "category"
 msgstr ""
 
-#: models.py:80
+#: models.py:92
 msgid "title"
 msgstr "título"
 
-#: models.py:82
+#: models.py:98
 msgid "highlight"
 msgstr ""
 
-#: models.py:84
+#: models.py:100
 msgid "featured image"
 msgstr ""
 
-#: models.py:88
+#: models.py:104
 msgid "body"
 msgstr "cuerpo"
 
-#: models.py:90
+#: models.py:106
 msgid "allow comments"
 msgstr ""
 
-#: models.py:96
+#: models.py:112
 msgid "user"
 msgstr ""
 
-#: models.py:98
+#: models.py:116
 msgid "creation time"
 msgstr ""
 
-#: models.py:99
+#: models.py:117
 msgid "modification time"
 msgstr ""
 
-#: models.py:101
+#: models.py:119
 msgid "publication time"
 msgstr ""
 
-#: models.py:117
+#: models.py:135
 msgid "entry"
 msgstr "entrada"
 
-#: models.py:118
+#: models.py:136
 msgid "entries"
 msgstr "entradas"
Add a comment to this file

diario/locale/fr/LC_MESSAGES/django.mo

Binary file modified.

diario/locale/fr/LC_MESSAGES/django.po

 msgstr ""
 "Project-Id-Version: Django Diário\n"
 "Report-Msgid-Bugs-To: https://bitbucket.org/semente/django-diario/issues\n"
-"POT-Creation-Date: 2013-09-17 18:13-0300\n"
-"PO-Revision-Date: 2013-09-17 21:13+0000\n"
+"POT-Creation-Date: 2013-09-23 17:10-0300\n"
+"PO-Revision-Date: 2013-09-23 20:11+0000\n"
 "Last-Translator: Guilherme Gondim <semente@taurinus.org>\n"
 "Language-Team: French (http://www.transifex.com/projects/p/django-diario/language/fr/)\n"
 "MIME-Version: 1.0\n"
 "Language: fr\n"
 "Plural-Forms: nplurals=2; plural=(n > 1);\n"
 
-#: admin.py:23
+#: admin.py:22
+msgid "Content"
+msgstr ""
+
+#: admin.py:25
+msgid "Archive"
+msgstr ""
+
+#: admin.py:28
+msgid "Discussion"
+msgstr ""
+
+#: admin.py:31
 msgid "Advanced"
 msgstr ""
 
-#: admin.py:38
+#: admin.py:45
 msgid "date"
 msgstr ""
 
-#: admin.py:45
+#: admin.py:52
 msgid "Highlighted"
 msgstr ""
 
-#: admin.py:51 models.py:75
+#: admin.py:58 models.py:87
 msgid "status"
 msgstr ""
 
-#: admin.py:59 models.py:58 models.py:106
+#: admin.py:66 models.py:66 models.py:124
 msgid "categories"
 msgstr ""
 
-#: admin.py:67 models.py:110
+#: admin.py:74 models.py:128
 msgid "tags"
 msgstr ""
 
 msgid "Last modified at {}"
 msgstr ""
 
-#: models.py:17
+#: models.py:20
 msgid ""
-"Automatically built from the title. A slug is a short label generally used "
-"in URLs."
-msgstr "Construit automatiquement à partir du titre. Un \"slug\" est une chaîne utilisée dans les URLs."
+"Automatically built from the title. A slug is a label generally used in "
+"URLs."
+msgstr ""
 
-#: models.py:52
+#: models.py:56
 msgid "name"
 msgstr ""
 
-#: models.py:53 models.py:81
+#: models.py:58 models.py:94
 msgid "slug"
 msgstr ""
 
-#: models.py:57
+#: models.py:65
 msgid "category"
 msgstr ""
 
-#: models.py:80
+#: models.py:92
 msgid "title"
 msgstr "titre"
 
-#: models.py:82
+#: models.py:98
 msgid "highlight"
 msgstr ""
 
-#: models.py:84
+#: models.py:100
 msgid "featured image"
 msgstr ""
 
-#: models.py:88
+#: models.py:104
 msgid "body"
 msgstr "corps"
 
-#: models.py:90
+#: models.py:106
 msgid "allow comments"
 msgstr ""
 
-#: models.py:96
+#: models.py:112
 msgid "user"
 msgstr ""
 
-#: models.py:98
+#: models.py:116
 msgid "creation time"
 msgstr ""
 
-#: models.py:99
+#: models.py:117
 msgid "modification time"
 msgstr ""
 
-#: models.py:101
+#: models.py:119
 msgid "publication time"
 msgstr ""
 
-#: models.py:117
+#: models.py:135
 msgid "entry"
 msgstr "article"
 
-#: models.py:118
+#: models.py:136
 msgid "entries"
 msgstr "articles"
Add a comment to this file

diario/locale/pt_BR/LC_MESSAGES/django.mo

Binary file modified.

diario/locale/pt_BR/LC_MESSAGES/django.po

 msgstr ""
 "Project-Id-Version: Django Diário\n"
 "Report-Msgid-Bugs-To: https://bitbucket.org/semente/django-diario/issues\n"
-"POT-Creation-Date: 2013-09-17 18:13-0300\n"
-"PO-Revision-Date: 2013-09-17 21:23+0000\n"
+"POT-Creation-Date: 2013-09-23 17:10-0300\n"
+"PO-Revision-Date: 2013-09-23 20:12+0000\n"
 "Last-Translator: Guilherme Gondim <semente@taurinus.org>\n"
 "Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/django-diario/language/pt_BR/)\n"
 "MIME-Version: 1.0\n"
 "Language: pt_BR\n"
 "Plural-Forms: nplurals=2; plural=(n > 1);\n"
 
-#: admin.py:23
+#: admin.py:22
+msgid "Content"
+msgstr "Conteúdo"
+
+#: admin.py:25
+msgid "Archive"
+msgstr "Arquivo"
+
+#: admin.py:28
+msgid "Discussion"
+msgstr "Discussão"
+
+#: admin.py:31
 msgid "Advanced"
 msgstr "Avançado"
 
-#: admin.py:38
+#: admin.py:45
 msgid "date"
 msgstr "data"
 
-#: admin.py:45
+#: admin.py:52
 msgid "Highlighted"
 msgstr "Destacado"
 
-#: admin.py:51 models.py:75
+#: admin.py:58 models.py:87
 msgid "status"
 msgstr "status"
 
-#: admin.py:59 models.py:58 models.py:106
+#: admin.py:66 models.py:66 models.py:124
 msgid "categories"
 msgstr "categorias"
 
-#: admin.py:67 models.py:110
+#: admin.py:74 models.py:128
 msgid "tags"
 msgstr "tags"
 
 msgid "Last modified at {}"
 msgstr "Última modificação em {}"
 
-#: models.py:17
+#: models.py:20
 msgid ""
-"Automatically built from the title. A slug is a short label generally used "
-"in URLs."
-msgstr "Construído automaticamente a partir do título. Um slug é uma pequena etiqueta geralmente utilizada em URLs."
+"Automatically built from the title. A slug is a label generally used in "
+"URLs."
+msgstr "Construído automaticamente a partir do título. Um slug é uma etiqueta geralmente utilizada em URLs."
 
-#: models.py:52
+#: models.py:56
 msgid "name"
 msgstr "nome"
 
-#: models.py:53 models.py:81
+#: models.py:58 models.py:94
 msgid "slug"
 msgstr "slug"
 
-#: models.py:57
+#: models.py:65
 msgid "category"
 msgstr "categoria"
 
-#: models.py:80
+#: models.py:92
 msgid "title"
 msgstr "título"
 
-#: models.py:82
+#: models.py:98
 msgid "highlight"
 msgstr "destacar"
 
-#: models.py:84
+#: models.py:100
 msgid "featured image"
 msgstr "imagem destacada"
 
-#: models.py:88
+#: models.py:104
 msgid "body"
 msgstr "corpo"
 
-#: models.py:90
+#: models.py:106
 msgid "allow comments"
 msgstr "permitir comentários"
 
-#: models.py:96
+#: models.py:112
 msgid "user"
 msgstr "usuário"
 
-#: models.py:98
+#: models.py:116
 msgid "creation time"
 msgstr "data de criação"
 
-#: models.py:99
+#: models.py:117
 msgid "modification time"
 msgstr "data de modificação"
 
-#: models.py:101
+#: models.py:119
 msgid "publication time"
 msgstr "data de publicação"
 
-#: models.py:117
+#: models.py:135
 msgid "entry"
 msgstr "artigo"
 
-#: models.py:118
+#: models.py:136
 msgid "entries"
 msgstr "artigos"
Add a comment to this file

diario/locale/ru/LC_MESSAGES/django.mo

Binary file modified.

diario/locale/ru/LC_MESSAGES/django.po

 msgstr ""
 "Project-Id-Version: Django Diário\n"
 "Report-Msgid-Bugs-To: https://bitbucket.org/semente/django-diario/issues\n"
-"POT-Creation-Date: 2013-09-17 18:13-0300\n"
-"PO-Revision-Date: 2013-09-17 21:13+0000\n"
+"POT-Creation-Date: 2013-09-23 17:10-0300\n"
+"PO-Revision-Date: 2013-09-23 20:11+0000\n"
 "Last-Translator: Guilherme Gondim <semente@taurinus.org>\n"
 "Language-Team: Russian (http://www.transifex.com/projects/p/django-diario/language/ru/)\n"
 "MIME-Version: 1.0\n"
 "Language: ru\n"
 "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
 
-#: admin.py:23
+#: admin.py:22
+msgid "Content"
+msgstr ""
+
+#: admin.py:25
+msgid "Archive"
+msgstr ""
+
+#: admin.py:28
+msgid "Discussion"
+msgstr ""
+
+#: admin.py:31
 msgid "Advanced"
 msgstr ""
 
-#: admin.py:38
+#: admin.py:45
 msgid "date"
 msgstr ""
 
-#: admin.py:45
+#: admin.py:52
 msgid "Highlighted"
 msgstr ""
 
-#: admin.py:51 models.py:75
+#: admin.py:58 models.py:87
 msgid "status"
 msgstr ""
 
-#: admin.py:59 models.py:58 models.py:106
+#: admin.py:66 models.py:66 models.py:124
 msgid "categories"
 msgstr ""
 
-#: admin.py:67 models.py:110
+#: admin.py:74 models.py:128
 msgid "tags"
 msgstr ""
 
 msgid "Last modified at {}"
 msgstr ""
 
-#: models.py:17
+#: models.py:20
 msgid ""
-"Automatically built from the title. A slug is a short label generally used "
-"in URLs."
-msgstr "Автоматически создается из заголовка. Slug -- это короткая надпись, обычно используемая в ссылках. "
+"Automatically built from the title. A slug is a label generally used in "
+"URLs."
+msgstr ""
 
-#: models.py:52
+#: models.py:56
 msgid "name"
 msgstr ""
 
-#: models.py:53 models.py:81
+#: models.py:58 models.py:94
 msgid "slug"
 msgstr "slug"
 
-#: models.py:57
+#: models.py:65
 msgid "category"
 msgstr ""
 
-#: models.py:80
+#: models.py:92
 msgid "title"
 msgstr "заголовок"
 
-#: models.py:82
+#: models.py:98
 msgid "highlight"
 msgstr ""
 
-#: models.py:84
+#: models.py:100
 msgid "featured image"
 msgstr ""
 
-#: models.py:88
+#: models.py:104
 msgid "body"
 msgstr "текст"
 
-#: models.py:90
+#: models.py:106
 msgid "allow comments"
 msgstr ""
 
-#: models.py:96
+#: models.py:112
 msgid "user"
 msgstr ""
 
-#: models.py:98
+#: models.py:116
 msgid "creation time"
 msgstr ""
 
-#: models.py:99
+#: models.py:117
 msgid "modification time"
 msgstr ""
 
-#: models.py:101
+#: models.py:119
 msgid "publication time"
 msgstr ""
 
-#: models.py:117
+#: models.py:135
 msgid "entry"
 msgstr "запись"
 
-#: models.py:118
+#: models.py:136
 msgid "entries"
 msgstr "записи"
Add a comment to this file

diario/locale/tr/LC_MESSAGES/django.mo

Binary file modified.

diario/locale/tr/LC_MESSAGES/django.po

 msgstr ""
 "Project-Id-Version: Django Diário\n"
 "Report-Msgid-Bugs-To: https://bitbucket.org/semente/django-diario/issues\n"
-"POT-Creation-Date: 2013-09-17 18:13-0300\n"
-"PO-Revision-Date: 2013-09-17 21:13+0000\n"
+"POT-Creation-Date: 2013-09-23 17:10-0300\n"
+"PO-Revision-Date: 2013-09-23 20:11+0000\n"
 "Last-Translator: Guilherme Gondim <semente@taurinus.org>\n"
 "Language-Team: Turkish (http://www.transifex.com/projects/p/django-diario/language/tr/)\n"
 "MIME-Version: 1.0\n"
 "Language: tr\n"
 "Plural-Forms: nplurals=2; plural=(n > 1);\n"
 
-#: admin.py:23
+#: admin.py:22
+msgid "Content"
+msgstr ""
+
+#: admin.py:25
+msgid "Archive"
+msgstr ""
+
+#: admin.py:28
+msgid "Discussion"
+msgstr ""
+
+#: admin.py:31
 msgid "Advanced"
 msgstr ""
 
-#: admin.py:38
+#: admin.py:45
 msgid "date"
 msgstr ""
 
-#: admin.py:45
+#: admin.py:52
 msgid "Highlighted"
 msgstr ""
 
-#: admin.py:51 models.py:75
+#: admin.py:58 models.py:87
 msgid "status"
 msgstr ""
 
-#: admin.py:59 models.py:58 models.py:106
+#: admin.py:66 models.py:66 models.py:124
 msgid "categories"
 msgstr ""
 
-#: admin.py:67 models.py:110
+#: admin.py:74 models.py:128
 msgid "tags"
 msgstr ""
 
 msgid "Last modified at {}"
 msgstr ""
 
-#: models.py:17
+#: models.py:20
 msgid ""
-"Automatically built from the title. A slug is a short label generally used "
-"in URLs."
+"Automatically built from the title. A slug is a label generally used in "
+"URLs."
 msgstr ""
 
-#: models.py:52
+#: models.py:56
 msgid "name"
 msgstr ""
 
-#: models.py:53 models.py:81
+#: models.py:58 models.py:94
 msgid "slug"
 msgstr ""
 
-#: models.py:57
+#: models.py:65
 msgid "category"
 msgstr ""
 
-#: models.py:80
+#: models.py:92
 msgid "title"
 msgstr ""
 
-#: models.py:82
+#: models.py:98
 msgid "highlight"
 msgstr ""
 
-#: models.py:84
+#: models.py:100
 msgid "featured image"
 msgstr ""
 
-#: models.py:88
+#: models.py:104
 msgid "body"
 msgstr ""
 
-#: models.py:90
+#: models.py:106
 msgid "allow comments"
 msgstr ""
 
-#: models.py:96
+#: models.py:112
 msgid "user"
 msgstr ""
 
-#: models.py:98
+#: models.py:116
 msgid "creation time"
 msgstr ""
 
-#: models.py:99
+#: models.py:117
 msgid "modification time"
 msgstr ""
 
-#: models.py:101
+#: models.py:119
 msgid "publication time"
 msgstr ""
 
-#: models.py:117
+#: models.py:135
 msgid "entry"
 msgstr ""
 
-#: models.py:118
+#: models.py:136
 msgid "entries"
 msgstr ""
 
 """Models definitions for Diário"""
 
-from os import path
+import binascii
+import os
 
 from django.conf import settings
 from django.db import models
+from django.utils import formats
 from django.utils.text import slugify
 from django.utils.timezone import now
-from django.utils.translation import ugettext_lazy as _
+from django.utils.translation import ugettext, ugettext_lazy as _
+
 from taggit.managers import TaggableManager
 
 from diario import app_settings
 
 
 SLUG_HELP_TEXT = _(
-    'Automatically built from the title. A slug is a short '
-    'label generally used in URLs.'
+    'Automatically built from the title. A slug is a label generally used '
+    'in URLs.'
 )
 
 
 def filefield_path(instance, filename):
     today = now()
     year, month = today.strftime('%Y'), today.strftime('%m')
-    filename = '{}-{}'.format(instance.id, filename)
+    uid = binascii.b2a_hex(os.urandom(2))
+    filename = '{}-{}'.format(uid, filename)
     classname = instance.__class__.__name__.lower()
-    return path.join(classname, year, month, filename)
+    return os.path.join(classname, year, month, filename)
 
 
 class EntryQuerySet(models.query.QuerySet):
 
     def is_hidden(self):
         return not self.status in self.VISIBLE_STATUS
+
+    def fancy_status(self):
+        html = '<strong>{}</strong><br /><small>{}</small>'
+        date = self.time_published if self.is_visible() else self.time_modified
+        fmt_date = formats.date_format(date, 'SHORT_DATETIME_FORMAT')
+        if self.is_visible() and self.highlight:
+            status = ugettext('Highlighted')
+        else:
+            status = self.get_status_display()
+        return html.format(status, fmt_date)
+    fancy_status.admin_order_field = 'status'
+    fancy_status.allow_tags = True
+    fancy_status.short_description = _('status')

diario/urls/__init__.py

 urlpatterns = patterns(
     'diario.views',
     url('^$', 'entry_list', name='entry-list'),
-    url('^(?P<pk>\d)-(?P<slug>[-\w]+)/$', 'entry_detail', name='entry-detail'),
-    url('^preview/(?P<pk>\d)/$', 'entry_preview', name='entry-preview'),
+    url('^(?P<pk>\d+)-(?P<slug>[-\w]+)/$', 'entry_detail', name='entry-detail'),
+    url('^preview/(?P<pk>\d+)/$', 'entry_preview', name='entry-preview'),
     url('^feed/$', 'feed', name='feed'),
 )
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.