1

I want to create a select field that displays a list of records from a column that is not a foreign key. I am able to do it using

widget=ForeignKeyRawIdWidget(rel=Slum._meta.get_field('electoral_ward').rel

where 'electoral_ward' is a foreign key in 'Slum' model.

But, I wish to have the same behavior for a field ('name') which is just a char field in 'Slum' model.

EDIT: I have a custom form (not a model form). In that form, I wish to have a selection field which will have slum names in the list. Instead of having a simple drop-down I need to have a raw field widget which will show a pop-up for selection. How do I achieve this?

Thank you!

Abhijit Ghate
  • 382
  • 3
  • 16

0 Answers0