Sunday, June 5, 2022

Re: ComboBox

Thanks for the responses. 
rgam - I appreciate what you are saying. I think it is roughly what I am doing now, but it is a bit clumsy in that  the user (of a financial application) will typically have a list of regular  customers to select from, and also may have other customers that are one-off, or infrequent which they will not want to clutter their options list with but still need to record against a transaction.
Ryan - thanks, the datalist looks like it might be right option. I will look at custom widgets.

All the best - Phil
On Wednesday, 1 June 2022 at 09:13:11 UTC+1 rgam...@gammascience.co.uk wrote:
Hi

If any arbitrary text is allowable, then at the model level I'd just use a CharField. I wouldn't add a choices= argument to the field unless is the value is strictly constrained to those choice as other test would then fail validation.

At the Form level, I'm not sure. I'd probably work just mirror what the frontend needed.

Does that help ?

On Tue, 2022-05-31 at 09:52 -0700, Phil Parkin wrote:
Hi all

I am converting a desktop application to Django web application. The desktop app uses comboboxes (editable dropdown/select). Is their any elegant way of applying the same functionality in Django? Stack Overflow etc. all seem to be about dropdown select lists only.

I can see ways of doing this with a Choicefield plus a separate Charfield, but is there a better way?

Thanks -Phil 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1b7836ae-e52e-4e35-aefc-739ce6f586d0n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/cdd3deef-3f9b-401b-b7df-864848d09086n%40googlegroups.com.

No comments:

Post a Comment