#28048: Generic date views don't work with related fields as date_field
-------------------------------------+-------------------------------------
Reporter: Lefteris | Owner: Lefteris Nikoltsios
Nikoltsios |
Type: | Status: assigned
Uncategorized |
Component: Generic | Version: 1.11
views |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
For example if we have some models like that:
{{{
class Blog(models.Model):
title = models.TextField()
pubdate = models.DateField()
class Article(models.Model):
blog = models.ForeignKey(Blog)
title = models.TextFIeld()
pubdate = models.DateField()
}}}
the following view:
{{{
from django.views.generic.dates import MonthArchiveView
from .models import Article
class ArticleMonthArchiveView(MonthArchiveView):
queryset = Article.objects.all()
date_field = 'blog__pub_date'
}}}
will raise FieldDoesNotExist.
--
Ticket URL: <https://code.djangoproject.com/ticket/28048>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/054.5cc41a461597807814c1ee1408833edf%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.