Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 377295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T14:40:57+00:00 2026-05-12T14:40:57+00:00

Hello (please excuse me for my ugly english :p), Imagine these two simple models

  • 0

Hello (please excuse me for my ugly english :p),

Imagine these two simple models :

from django.contrib.contenttypes import generic
from django.db import models

class SomeModel(models.Model):
    content_type = models.ForeignKey(ContentType)
    object_id = models.PositiveIntegerField(_('object id'))
    content_object = generic.GenericForeignKey('content_type', 'object_id')

    published_at = models.DateTimeField('Publication date')


class SomeOtherModel(models.Model):
    related = generic.GenericRelation(SomeModel)

I would like to use the archive_index generic view with SomeOtherModel, but it doesn’t work :

from django.views.generic.date_based import archive_index

archive_index(request, SometherModel.objects.all(), 'related__published_at')

The error comes from archive_index at line 28 (using django 1.1) :

date_list = queryset.dates(date_field, 'year')[::-1]

The raised exception is :

SomeOtherModel has no field named 'related__published_at'

Have you any idea to fix it ?

Thank you very much 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T14:40:57+00:00Added an answer on May 12, 2026 at 2:40 pm

    From digging through the Django source code, the generic view archive_index does not appear to support related fields that are GenericRelations.

    This is because the queryset method dates does not support generic relations. Consider filing this as a bug / feature request on the Django bug tracker.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello (please excuse me for my bad english ;) ), Imagine the classes bellow:
Ok, I'm coming from Django, so please excuse me if what I write doesn't
Hello I blocked in the creation of a simple table please help me using
Hello guys can you please help me with this problem. When a simple image
Hello everyone I am new to flex so please excuse if it is noob
Hello please help me out regarding returning the variable from the function I am
hello please help me out regarding this query ,I am fetching data from different
Hello friends I have tried many times but I am not successful than please
Please help me with using the DrScheme built-in function filter. create a function hello
hello Friends please verify my code Is it a right way to pass optional

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.