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 424367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:16:22+00:00 2026-05-12T19:16:22+00:00

I am building an article site using django. I’ve added many to many relation

  • 0

I am building an article site using django.
I’ve added many to many relation between my articles this way:

class Article (models.Model):
    # Tiny url
    url = models.CharField(max_length = 30, unique=True)
    is_published = models.BooleanField()
    author = models.CharField(max_length = 150)
    title = models.CharField(max_length = 200)
    short_description = models.TextField(max_length = 600)
    body = tinymce_models.HTMLField()
    related = models.ManyToManyField("self")

Now in my admin site, I see multiple select box ( see image here http://img.skitch.com/20091017-mfs2mbhbuudk2rgquium1bu61d.png)

What I want is to use this box usable for a user who will chose articles to bind them to a current one. So for example, is there a way to add some filtering there? E.g. If I would like to filter all articles by section? And then dismiss previous results and filter the whole set by name, etc?

Thanks in advance

+++

I am trying to investigate possibility to add filter horizontal to admin. But after I added it this way:

class ArticleAdmin(admin.ModelAdmin):
    exclude = ('video', )

    js = ('/site_media/js/tiny_mce/tiny_mce.js', 
          )
    list_display = ('title', 'author', 'section', 'is_published', 'pub_date')
    list_filter = ('author', 'section', 'is_published', 'pub_date')
    filter_horizontal = ['related', ]
    search_fields = ['body', 'title', 'short_description', 'seo_keywords']

All articles vanished from admin 🙁

  • 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-12T19:16:23+00:00Added an answer on May 12, 2026 at 7:16 pm

    If you look for basic filtering, try this or that:

    If you want to customize filtering, you could actually do it. A little guide:

    Subclass forms.SelectMultiple or directly the existing FilteredSelectMultiple from django.contrib.admin.widgets and make it do what you want.

    Then subclass ModelAdmin in your admin.py and overwrite formfield_for_manytomany (look in django.contrib.admin.options for that method) and exchange the existing widget with your new one.

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

Sidebar

Ask A Question

Stats

  • Questions 274k
  • Answers 274k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The original book on Design patterns (Design Patterns: Elements of… May 13, 2026 at 2:25 pm
  • Editorial Team
    Editorial Team added an answer I would recommend getting a good book on iPhone programming.… May 13, 2026 at 2:25 pm
  • Editorial Team
    Editorial Team added an answer With the DefaultOuput AudioUnit you only set the input side… May 13, 2026 at 2:25 pm

Related Questions

I am building an article site using django. I've added many to many relation
I am building an online article website. I have a php script called view_article.php
I am trying to replicate the exact functionality of this dialogue in Visual Studio
This might be a too bigger ask, but before I outsource it, I would
I'm trying to build the search for a Django site I am building, and

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.