Ajax foreign key filter in Django admin interface

http://blog.philippmetzler.com/?p=52

Just tried the django-ajax-filtered fields and liked it. Im looking for a solution to this problem:

My model looks like this:

class Song (models.Model): Album = models.ForeignKey (Album)

class Artist (models.Model): album = models.ForeignKey (Album) song = models.ForeignKey (Song, empty = True, null = True)

Therefore, the user must determine the topic. He can also identify a sub-topic, but is not required. The subtopic relates to the topic.

In the admin interface Id, you can limit the selection for a subtopic based on what it selects by topic. This should change dynamically with AJAX. I will look in more detail at the django-ajax-filters fields, but have not found a solution to this particular problem.

Perhaps this is another utility for django-ajax-filtered fields in general? Or do you know another solution to my specific requirements?

+3
source share

Source: https://habr.com/ru/post/1741075/


All Articles