Prav001
Prav001

Reputation: 355

Using entries in database table column to populate Django Combo Box

I am trying to create a drop down menu using Django field "Choices", however for this I have to hand code the value in python code.Is there any way by which I can make Django to take the Dropdown list entries from column of a particular table. Thanks in advance

Upvotes: 1

Views: 704

Answers (1)

Daniel Roseman
Daniel Roseman

Reputation: 599630

Use a ModelChoiceField, which is specifically for that.

Upvotes: 3

Related Questions