diff options
author | Caleb Forbes Davis V <caldavis@gmail.com> | 2011-07-12 22:26:10 -0500 |
---|---|---|
committer | Caleb Forbes Davis V <caldavis@gmail.com> | 2011-07-12 22:43:26 -0500 |
commit | 6f2e4585cc7475362205a9ddb0e69d6da2b6dc85 (patch) | |
tree | 17bef36aa8a5ee3d15785495884fb3768ded52e0 /mediagoblin/util.py | |
parent | 93e3468a2af92a623a659628a20605025cea9ca7 (diff) | |
download | mediagoblin-6f2e4585cc7475362205a9ddb0e69d6da2b6dc85.tar.lz mediagoblin-6f2e4585cc7475362205a9ddb0e69d6da2b6dc85.tar.xz mediagoblin-6f2e4585cc7475362205a9ddb0e69d6da2b6dc85.zip |
uses standard functions instead of form filters and fixes taglist default
- seems simpler to use the same tag field processing procedures on media
submit and edit, so now processing with a regular function instead of
a form filter. Filters run on form load and post by default.
- moved tags to sidebar
- taglist defaults to [] instead of None
- adds case sensitivity toggle
Diffstat (limited to 'mediagoblin/util.py')
-rw-r--r-- | mediagoblin/util.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/mediagoblin/util.py b/mediagoblin/util.py index 4421bec4..f2a2793b 100644 --- a/mediagoblin/util.py +++ b/mediagoblin/util.py @@ -371,6 +371,7 @@ def clean_html(html): TAGS_DELIMITER = u' ' +TAGS_CASE_SENSITIVE = False def convert_to_tag_list(tag_string): """ @@ -379,12 +380,16 @@ def convert_to_tag_list(tag_string): Strips trailing, leading, and internal whitespace, and also converts the user input into an array of tags """ + taglist = [] if tag_string: - taglist = [] stripped_tag_string = u' '.join(tag_string.strip().split()) for tag in stripped_tag_string.split(TAGS_DELIMITER): - if tag.strip(): taglist.append(tag.strip()) - return taglist + if tag.strip(): + if TAGS_CASE_SENSITIVE: + taglist.append(tag.strip()) + else: + taglist.append(tag.strip().lower()) + return taglist MARKDOWN_INSTANCE = markdown.Markdown(safe_mode='escape') |