Hi all,

I've got a couple of related models that I want to use together in a
queryset, which I will be passing to a the generic view
"date_based.archive_index". This generic view requires a "date_field"
argument specifying "the name of the field that the date-based archive
[view] should use to determine the objects on the page".
(http://docs.djangoproject.com/en/dev/ref/generic-views/#django-views-generic-date-based-archive-index)

When I do thisk, I'm getting an error of FieldDoesNotExist ... PostI18N
has no field named 'post__date'

I'm creating my queryset like this:
    return date_based.archive_index(
        request,
        queryset =
PostI18N.objects.filter(lang=request.LANGUAGE_CODE).order_by('post__date').select_related(),
        date_field = 'post__date',
        template_name = "posts/posts_by_tag_date.html",
        template_object_name = "latest",
        extra_context = xcontextdict
    )


The way I've got it set up in the models is:

######
# The parent of all the posts,
# only one item per post in here
######
class Post(models.Model):
referencetitle = models.CharField(max_length=30)
date = models.DateTimeField('Date')

######
# language content for each post
# there will be two items per post in here, one for each language
######
class PostI18N(models.Model):
post = models.ForeignKey(Post)
slug = models.SlugField(
'Slug',
help_text='Automatically built from the title.'
)
title = models.CharField('Title', max_length=30)
body = models.TextField('Body Text')
lang = models.CharField(max_length = 5, choices = settings.LANGUAGES)



Thanks for any help you can give me with this,
J


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to