Does Django Admin support dynamic loading of category-based attributes with predefined values?

I’m working on a project using Django where I have a category-based system. Each category has its own set of dynamic attributes.

When creating a new product:

The category is selected first.
Based on the selected category, its related attributes should be displayed.
Some attributes have predefined values (choices) to reduce errors, while others allow free input.

What I’m trying to achieve:

When selecting a category in Django Admin, the related attributes should load dynamically.
If an attribute has predefined values, it should appear as a dropdown (select field).
If not, it should appear as a regular input field.

Question:
Does Django Admin support this functionality out of the box?
If yes, what is the best way to implement it?
If not, what is the recommended approach ?

1 Like

No

Don’t use the Django Admin for this. Write your own views, and use something like Django-select2 to help add that functionality.

Quoting directly from the docs at The Django admin site | Django documentation | Django

If you need to provide a more process-centric interface that abstracts away the implementation details of database tables and fields, then it’s probably time to write your own views.

Can you get the Django admin to do this? Yes, but my experience from watching many people try to support custom functionality like this has convinced me that this is one of those situations where you’re really better off without.