django-smart-selects icon indicating copy to clipboard operation
django-smart-selects copied to clipboard

[idea] : Adding kw/arg 'display_model_col' to ChainedForeignKey et al.

Open pareshpandit opened this issue 3 years ago • 0 comments
trafficstars

Hello folks!

First of all, thank you all so much for this amazing project - simple does it! :)

From my recent experience (or lack thereof), I felt the need to call a particular column from a model when loading it as a related/dependent dropdown in a form, using ChainedForeignKey.

Basically, if we could have an kw/arg that shall tell dictate that the form rendering use a column named so and so, when displaying the dropdown on the frontend, for a particular field (from its model table).

For example, it presently defaults to the 'name' column of a Model, I have observed. However, I would like to take it to the 'name_ascii' column of my tables.

This is because, in my DB tables, the name column contains "child, parent, grandparent" kind of entry in a three-tiered chain. Now, This creates repetition on the form, and of course, in its entries too. Thus, I would like to control that the singular name (self name only) column is picked for display, and thence posting.

I hope that you also find this worth implementing, and that we might have it available sometime soon. Have a nice day! :)

pareshpandit avatar Jun 10 '22 12:06 pareshpandit