The Zope Bible phần 8

Bước đầu tiên trong việc xây dựng các bánh xe của ứng dụng thực phẩm để tạo ra các thư mục / WOF. Mở một trình duyệt Web, màn hình quản lý của Zope, và trong thư mục gốc, tạo ra một thư mục mới với id của WOF. | Chapter 14 Core Zope Components 425 Method Description setBase base Sets the base URL for the returned document. expireCookie name kw Causes an HTTP cookie to be removed from the browser. The response will include an HTTP header that will remove the cookie corresponding to name on the client if one exists. This is accomplished by sending a new cookie with an expiration date that has already passed. Note that some clients require a path to be specified. This path must exactly match the path given when creating the cookie. The path can be specified as a keyword argument. appendCookie name value Returns an HTTP header that sets a cookie on cookie-enabled browsers with a key name and value value . If a value for the cookie has previously been set in the response object the new value is appended to the old one separated by a colon. redirect location lock 0 Causes a redirection without raising an error. If the lock keyword argument is passed with a true value the HTTP redirect response code will not be changed even if an error occurs later in request processing after redirect has been called . Create Dynamic Text with DocumentTemplates In Chapter 4 we showed you how to create dynamic Web pages using DTML methods and documents. In this section we will show you how to use and extend the underlying class library that generates dynamic text documents based on templates. The examples in this section will be used to generate HTML. Although DTML isn t limited to the use of HTML it s just such a natural fit that it s almost difficult to imagine better examples. So we re going to take the path of least resistance for this section. We ll leave it up to you if desired to find other uses for DTML. The name of the library is DocumentTemplate. It can be found under lib python DocumentTemplate of your Zope installation. With this library you can create callable template objects. 426 Part IV Advanced Zope Concepts A callable object is a Python object that implements the_call_hook. .

TÀI LIỆU XEM NHIỀU
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG