How to limit choice field options based on another choice field in django admin

前端 未结 3 581
盖世英雄少女心
盖世英雄少女心 2020-12-05 00:57

I have the following models:

class Category(models.Model):
    name = models.CharField(max_length=40)

class Item(models.Model):
    name = models.CharField(         


        
3条回答
  •  隐瞒了意图╮
    2020-12-05 02:01

    You will need to have some kind of non-server based mechanism of filtering the objects. Either that, or you can reload the page when the selection is made (which is likely to be done in JavaScript anyway).

    Otherwise, there is no way to get the subset of data from the server to the client.

提交回复
热议问题