jqb / django-settings

Application to keep simple settings in database. Based on the contenttype framework.
BSD 3-Clause "New" or "Revised" License
83 stars 47 forks source link

Added forms.py check for proper variable names #7

Closed jaywhy13 closed 5 years ago

jaywhy13 commented 11 years ago

Just added a check in the forms.py to ensure that no weird characters like spaces are used in variable names. The only thing allowed is (A-Z, a-z, 0-9, _).

jqb commented 11 years ago

Thank you very much for contribution :) However could you please explain to me why you think limiting variables names to just A-Z,a-z,0-9 words is better?

jaywhy13 commented 11 years ago

Oh, I didn't get to run some more tests and pinpoint exactly what the problem was. I was in a bit of a rush. I had set up my cache backend to use Memcache. Memcache complained about the keys with spaces in them though, which I found to be a bit strange. When I try to create a key with spaces from the admin I got an error.

jqb commented 11 years ago

Oh.... you are right! But one little thing - I found it really common to use ":" (colon) and "-" (minus) as a separator for "namespaces" in memcache key names. Please add the possibility to use them.

And don't forget to add your self to "contributor" section as well! :)

jaywhy13 commented 11 years ago

Huh? Could you explain a little more. By the way, this is my first ever pull request :) so baby steps :D

jqb commented 11 years ago

Ok. It's really common to use memcache keys like: "global:my_setting_1", or "more-concrete-options:setting_2". Also it would be nice to be able to use "-" in key names (like "my-fancy-memcache-key"). So please add both ":" and "-" signs as a possible characters in key names.

And the other thing is: add yourself to README "contributor" section - you can find some other people there - so just and yourself there in the same way.