Open Warkinstar opened 4 days ago
Hey
yes, slugify
removes all no-ascii characters it seems. Here's the relevant issue for that:
https://code.djangoproject.com/ticket/8391
I'm not sure but maybe we could stop slugifying options altogether? @mjl Do you have any opinions on this?
@matthiask Yes, I removed slugify and everything worked.
def get_choices(self):
def get_tuple(value):
# return (slugify(value.strip()), value.strip()) # Original
return (value.strip(), value.strip())
I'm not sure but maybe we could stop slugifying options altogether? @mjl Do you have any opinions on this?
No strong opinion. I personally like my option values ascii-able because I grew up in a pre-Unicode era :-), but nowadays and in an automated setting like with form-designer it does not really matter.
Do we need to be careful about quotes or other nasties?
I'm fine with removing the slugifying.
On a tangent: It would be nice to be able to somehow explicitely specify the option values in case some automated processing is run on the form entries later; I have several cases of having options that read "yes-i-have-read-the-terms-and-conditions-and-promise-to-be-a-good-boy-while-waiting-for-santa" which is 1) ridiculous, and 2) need to keep the option value in the external program in sync with the text.
Perhaps something like specifying "male=A Man,female=A Woman,droid=Some EVIL Robot" as option definition would do the trick? But again, that's an enhancement and not directly related with the problem at hand.
Do we need to be careful about quotes or other nasties?
I don't think we have to. The HTML escaping which is automatically applied to values should be sufficient. TBH I don't really remember why I added the slugification (is that even a word?) in the first place.
On a tangent: It would be nice to be able to somehow explicitely specify the option values in case some automated processing is run on the form entries later; I have several cases of having options that read "yes-i-have-read-the-terms-and-conditions-and-promise-to-be-a-good-boy-while-waiting-for-santa" which is 1) ridiculous, and 2) need to keep the option value in the external program in sync with the text.
Yes, that's an excellent point. By the way, I recently changed the code to at least try to return the unslugified variant here https://github.com/feincms/form-designer/commit/f59ed76ec321df086a447c4d86bf51fd47737955 but storing the value as-is would have made that obsolete. At least if there weren't any concerns about preserving already submitted data.
Hello everyone, I encountered a problem that the form is rendered without select values that do not use English letters.