We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
How about this? Not sure whether it's in scope for form-designer or people are expected to roll their own solution?
def email_field_choices(form: forms.ModelForm | None, required: bool=True) -> list[tuple[str, str]]: if not form: return [] email_fields = form.instance.fields.filter(type='email') choices = [] if required else [('', '--')] choices.extend([(_.name, _.title) for _ in email_fields]) return choices ... class Form(models.Model): CONFIG_OPTIONS = [ ... "author_email_field", forms.ChoiceField( required=False, choices=email_field_choices(form, required=False)
The text was updated successfully, but these errors were encountered:
Yes! I like it a lot.
Sorry, something went wrong.
merged #40
Thanks!
mjl
No branches or pull requests
How about this? Not sure whether it's in scope for form-designer or people are expected to roll their own solution?
The text was updated successfully, but these errors were encountered: