diff options
author | Caleb Forbes Davis V <caldavis@gmail.com> | 2011-07-27 14:42:09 -0500 |
---|---|---|
committer | Caleb Forbes Davis V <caldavis@gmail.com> | 2011-07-27 14:51:57 -0500 |
commit | 0712a06dc6d6b05cb78d4b10af12c051e8f765e3 (patch) | |
tree | 16feba97f0589fdf1c2811c23340f4a002a1ae47 /mediagoblin/edit | |
parent | 97e4498c10c803c9d239011d4c48efef52673ec3 (diff) | |
download | mediagoblin-0712a06dc6d6b05cb78d4b10af12c051e8f765e3.tar.lz mediagoblin-0712a06dc6d6b05cb78d4b10af12c051e8f765e3.tar.xz mediagoblin-0712a06dc6d6b05cb78d4b10af12c051e8f765e3.zip |
changes tags to a list of dicts in the db, adding tag slugs
- adds a function to convert the tag list of dicts to a text string
properly delimited for loading into forms
- tag string conversion function updated to generate list of dicts
- updates all mentions of the conversion of the string to the tags db
object
- adds a tags template utility and updates the media template accordingly
Diffstat (limited to 'mediagoblin/edit')
-rw-r--r-- | mediagoblin/edit/views.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/mediagoblin/edit/views.py b/mediagoblin/edit/views.py index 3193bfa3..e4ebe8d7 100644 --- a/mediagoblin/edit/views.py +++ b/mediagoblin/edit/views.py @@ -21,7 +21,8 @@ from string import split from mediagoblin import messages from mediagoblin import mg_globals from mediagoblin.util import ( - render_to_response, redirect, clean_html, convert_to_tag_list) + render_to_response, redirect, clean_html, convert_to_tag_list_of_dicts, + media_tags_as_string) from mediagoblin.edit import forms from mediagoblin.edit.lib import may_edit_media from mediagoblin.decorators import require_active_login, get_user_media_entry @@ -39,7 +40,7 @@ def edit_media(request, media): title = media['title'], slug = media['slug'], description = media['description'], - tags = mg_globals.app_config['tags_delimiter'].join(media['tags'])) + tags = media_tags_as_string(media['tags'])) if request.method == 'POST' and form.validate(): # Make sure there isn't already a MediaEntry with such a slug @@ -55,7 +56,8 @@ def edit_media(request, media): else: media['title'] = request.POST['title'] media['description'] = request.POST.get('description') - media['tags'] = convert_to_tag_list(request.POST.get('tags')) + media['tags'] = convert_to_tag_list_of_dicts( + request.POST.get('tags')) md = markdown.Markdown( safe_mode = 'escape') |