hi all,
im really going crazy now i cant figure out where the code is wrong...
i have a really simple model:
from django.db import models
import datetime
class Post(models.Model):
title = models.CharField(max_length=250)
excerpt = models.TextField(blank=True)
body = models.TextField()
pub_date = models.DateTimeField(default=datetime.datetime.now)
slug = models.SlugField(unique_for_date='pub_date')
class Meta:
verbose_name_plural = "Posts"
ordering = ['-pub_date']
def __unicode__(self):
return self.title
def get_absolute_url(self):
return ('wynton_post_detail', (), { 'year':
self.pub_date.strftime("%Y"),
'month':
self.pub_date.strftime("%b").lower(),
'day':
self.pub_date.strftime("%d"),
'slug': self.slug })
get_absolute_url = models.permalink(get_absolute_url)
my urls file:
from django.conf.urls.defaults import *
from wynton.models import Post
post_info_dict = {
'queryset': Post.objects.all(),
'date_field': 'pub_date',
}
urlpatterns = patterns('django.views.generic.date_based',
(r'archive/^$', 'archive_index', post_info_dict,
'wynton_post_archive_index'),
...
)
my post_archive.html
{% for object in latest %}
{{ object.title }}
{% endfor %}
but nothing is showing up in the page but the template is loaded
correctly...
please help me before i crash my head to the wall! ;)
thx
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---