M
M
Mooris2018-05-30 11:06:00
Django
Mooris, 2018-05-30 11:06:00

How to display subcategory depending on category in Django admin?

Hello, tell me what is the best way to make subcategories in the admin panel, all in separate selects using ajax (example in GIF). I decided to use django-smart-selects, but it doesn't work, the problem is that it doesn't return any values.

spoiler
lwdcsjz3yhdjode72o0mgmjmtyo.gif

More details about the
task
  • Russia
  • USA

When choosing the category Russia, in the model select, the subcategory Cities appeared
  • Moscow
  • Peter
  • Eagle
  • .......

When choosing the category USA, in the select subcategory Cities appeared
  • New York
  • Los Angeles
  • Chicago
  • .......

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question