Still totally useless but at least it writes to the database
This commit is contained in:
parent
fbf7880e68
commit
bda3405342
@ -64,7 +64,7 @@ class MediagoblinApp(object):
|
||||
|
||||
def paste_app_factory(global_config, **kw):
|
||||
connection = pymongo.Connection()
|
||||
db = kw.get('db_name', 'mediagoblin')
|
||||
db = connection[kw.get('db_name', 'mediagoblin')]
|
||||
|
||||
return MediagoblinApp(
|
||||
db,
|
||||
|
@ -1,6 +1,7 @@
|
||||
<html>
|
||||
<body>
|
||||
<form action="{{ request.urlgen('test_submit') }}" method="POST">
|
||||
<form action="{{ request.urlgen('test_submit') }}" method="POST"
|
||||
enctype="multipart/form-data">
|
||||
<table>
|
||||
{% for field in image_form %}
|
||||
<tr>
|
||||
|
@ -1,3 +1,5 @@
|
||||
import datetime
|
||||
|
||||
from webob import Response, exc
|
||||
import wtforms
|
||||
|
||||
@ -17,7 +19,11 @@ def submit_test(request):
|
||||
image_form = ImageSubmitForm(request.POST)
|
||||
if request.method == 'POST' and image_form.validate():
|
||||
# create entry and save in database
|
||||
|
||||
work_id = request.app.db.works.insert(
|
||||
{'title': image_form.title.data,
|
||||
'created': datetime.datetime.now(),
|
||||
'description': image_form.description.data})
|
||||
|
||||
# save file to disk
|
||||
## TODO
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user