Merge branch 'remotes/gullydwarf-cfdv/f360_tagging' (early part) into mergetags

Conflicts:
	mediagoblin/config_spec.ini
	mediagoblin/edit/views.py
	mediagoblin/util.py
This commit is contained in:
Christopher Allan Webber
2011-07-30 13:09:01 -05:00
11 changed files with 134 additions and 6 deletions

View File

@@ -16,6 +16,7 @@
import wtforms
from mediagoblin.util import tag_length_validator, TOO_LONG_TAG_WARNING
class SubmitStartForm(wtforms.Form):
@@ -24,3 +25,6 @@ class SubmitStartForm(wtforms.Form):
[wtforms.validators.Length(min=0, max=500)])
description = wtforms.TextAreaField('Description of this work')
file = wtforms.FileField('File')
tags = wtforms.TextField(
'Tags',
[tag_length_validator])

View File

@@ -16,11 +16,13 @@
from os.path import splitext
from cgi import FieldStorage
from string import split
from werkzeug.utils import secure_filename
from mediagoblin.util import (
render_to_response, redirect, cleaned_markdown_conversion)
render_to_response, redirect, cleaned_markdown_conversion, \
convert_to_tag_list_of_dicts)
from mediagoblin.decorators import require_active_login
from mediagoblin.submit import forms as submit_forms, security
from mediagoblin.process_media import process_media_initial
@@ -59,6 +61,10 @@ def submit_start(request):
entry['media_type'] = u'image' # heh
entry['uploader'] = request.user['_id']
# Process the user's folksonomy "tags"
entry['tags'] = convert_to_tag_list_of_dicts(
request.POST.get('tags'))
# Save, just so we can get the entry id for the sake of using
# it to generate the file path
entry.save(validate=False)