diff --git a/curriculum/section14/lectures/14_edit_movies_pre_populate_wtform/README.md b/curriculum/section14/lectures/14_edit_movies_pre_populate_wtform/README.md index 4accea78..30e073b6 100644 --- a/curriculum/section14/lectures/14_edit_movies_pre_populate_wtform/README.md +++ b/curriculum/section14/lectures/14_edit_movies_pre_populate_wtform/README.md @@ -54,7 +54,22 @@ Note that the form pre-population mechanism is the `obj=movie` part. ## Rendering the extended movie form -Let's create the `templates/movie_form.html` template: +First, let's edit the `templates/macros/fields.html` template to add the a new macro in order to render the custom field: + +```jinja2 +{% macro render_area_field(field) %} +
{{ movie.description }}
+ {% else %} +-No description yet. Add one?
++No description yet. Add one?
+ {% endif %} +... +``` + Also nothing new here! Note that our custom WTForm field is identical to the `TextAreaField`, except when it comes to receiving form data and putting it in our Python object. Everything else behaves the same way as the parent class.