Lines Matching refs:we

37 application we'll be storing the pages under a directory.
48 we'll implement a ``__call__`` method:
55 # what we'll fill in
57 To make the script runnable we'll create a simple command-line
125 For the wiki application we'll support a couple different kinds of
126 screens, and we'll make our ``__call__`` method dispatch to different
137 One last thing we'll do in our ``__call__`` method is create our
153 # Here's where we get the Page domain object:
205 never really be sure. By using ``os.path.normpath`` we eliminate
206 these, and then we make absolutely sure that the resulting path is
226 # we need to guess the title
326 We have a dispatching function with ``__call__`` and we have a domain
327 object with ``Page``, but we aren't actually doing anything.
349 The first thing we do is redirect the user to the edit screen if the
353 Otherwise we fill in a template. The template language we're going to
390 escaping. Our wiki will just be written in plain HTML, so we disable
412 To allow conditional responses we set ``resp.last_modified``. You can
418 (or None). With this header we can process requests with
477 In ``<form action="{{req.path_url}}" method="POST">`` we submit to
478 ``req.path_url``; that's everything *but* ``?action=edit``. So we are
485 we can detect concurrent updates. If start editing the page who's
487 the mtime to 100010, we can use this hidden field to detect that
489 outside the scope of this particular tutorial, we'll just note the
492 From there we just have a very straight-forward HTML form. Note that
493 we don't quote the values because that is done automatically by
499 were error conditions we might have to re-display this form with the
500 input values the user already gave. In that case we'd do something
506 This way we use the value in the request (``req.params`` is both the
508 there is no value (e.g., first request) then we use the page values.
514 action). So we have to implement that method:
533 The first thing we do is check the mtime value. It can be an empty
536 makes sure we don't pass ``""`` to ``int()`` (which is an error) then
539 If it fails we just give a not-very-helpful error message, using ``412
541 ``If-Unmodified-Since``, but we can't really get the browser to send
542 requests like that, so we use the hidden field instead).
565 After we check the mtime we get the form parameters from
571 In this example we've used ``req.params`` for all the form values. If
572 we wanted to be specific about where we get the values from, they
588 One last little improvement we can do is show the user a message when
593 display it in the page view. To set it on save, we add a little to
636 ``req.cookies`` is just a dictionary, and we also delete the cookie if