Skip to content

Commit 2d5d523

Browse files
committed
Extend example app with file field
1 parent 80f4849 commit 2d5d523

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

example_app/binary_demo.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class BinaryDemoModel(db.Document):
99
string_field = db.StringField()
1010
binary_field = db.BinaryField()
1111
binary_field_with_default = db.BinaryField(default=lambda: "foobar".encode("utf-8"))
12+
file_field = db.FileField()
1213

1314

1415
def binary_demo_view(pk=None):

example_app/templates/form_demo.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
{{ render_navigation(page, view) }}
3131
</div>
3232
<div>
33-
<form method="POST">
33+
<form method="POST" enctype="multipart/form-data">
3434
{% for field in form %}
3535
{{ render_field(field, style='font-weight: bold') }}
3636
{% endfor %}

0 commit comments

Comments
 (0)