Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make filter use foreign key config #35

Open
msouth opened this issue Aug 16, 2013 · 1 comment
Open

make filter use foreign key config #35

msouth opened this issue Aug 16, 2013 · 1 comment
Labels

Comments

@msouth
Copy link
Collaborator

msouth commented Aug 16, 2013

If you have a table with a foreign key and a name column defined, it would be nice for the filter for that column in the filter to give you a dropdown showing the name values to select from--or at least let you type that in instead of knowing the id of the row in the foreign key.

(I am just putting this here because I thought of it, I didn't look to see if there is already a capability or something in the works. Just didn't want to forget.)

@joshrabinowitz
Copy link
Contributor

Clearly fetching this data could require a potentially slow sql query and/or one with a large result set.

Perhaps there could be a optional config option (say, 'foreign_field_value_enums' or the like) to spec the allowed values for foreign key fields - which could dynamically fetch them from the database at runtime.

Also, this is similar to the case of a popdown appearing in the /add or /edit forms. (That case is somewhat supported by the CGI::FormBuilder options you can use in D:P:SC's 'validation' option. It doesn't apply to foreign keys, but you can use 'enum' fields get a dropdown ). The hypothetical 'foreign_field_value_enums' (or something even more general) could presumably apply to both cases (search field and add/edit forms).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants