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

  • SEARCH
  • Home
  • 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 7589269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:07:06+00:00 2026-05-30T20:07:06+00:00

I am trying to manage the admin console. I have two models, a venue

  • 0

I am trying to manage the admin console.

I have two models, a venue and an event: events can happen at venues and events have a timestamp.

In my admin console I have added the events to be listed in the venues admin by using inlines.

However I want to set up a case where, by default only events from timestamp.now() into the future are listed and all events before teimstamp.now() are not shown.

I am limited to Django 1.3 at the moment, but I believe Django 1.4 has a type of solution in SimpleListFilter.

I have read somewhere that DateFieldFilterSpec can be used, but documentation and examples are very lacking. (Can you point me out some references if you have them?)

In the python code below there is no connection between the import of DateFieldFilterSpec to the code shown below, but I have no idea where or how they are connected.

admin.py

from django.contrib.admin.filterspecs import DateFieldFilterSpec

class eventInline(admin.TabularInline):

    list_filter = ('now')

    model = event
    extra = 1

class VenueAdmin(admin.ModelAdmin):
   inlines = [eventInline,]

When I use the above code I just get all the events, there doesn’t seem to be any filtering.

  • 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-30T20:07:08+00:00Added an answer on May 30, 2026 at 8:07 pm

    How about modifying the queryset for that purpose (replace eventdate with the name of the field that holds the date of an event):

    from datetime import datetime
    from django.contrib import admin
    
    class eventInline(admin.TabularInline):
        def queryset(self, request):
            qs = super(eventInline, self).queryset(request)
            return qs.filter(eventdate__gte=datetime.now)
        model = event
        extra = 1
    
    class VenueAdmin(admin.ModelAdmin):
       inlines = [eventInline,]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a desktop application written in C#. It is trying to manage a
I'm trying to figure out how to manage my event ids. Up to this
I'm trying to get Django's manage.py to run with modified settings files. I have
trying to understand how custom admin commands work, I have my project named mailing
I'm trying to get insights from facebook for some pages I have admin rights
I'm trying to manually manage some geometry (spatial) columns in a rails model. When
I am trying to work out how to manage the following relationships A Store
I am trying to install VisualSVN to manage my code with other users. In
I'm trying to use libvirt with virsh to manage my kvm/qemu vms. The problem
I am currently trying to use NAnt and CruiseControl.NET to manage various aspects of

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.