SVN: r25682 - trunk/quixote/doc
David Binger <dbinger-fVcApmY9cLvQ3/1i3zOLAti2O/[email protected]> Mon, 6 Dec 2004 19:00:47 -0500
| Newsgroups | gmane.comp.web.quixote.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: dbinger Date: 2004-11-29 21:05:38 -0500 (Mon, 29 Nov 2004) New Revision: 25682 Modified: trunk/quixote/doc/upgrading.txt Log: Add q1 -> q2 upgrade notes. Modified: trunk/quixote/doc/upgrading.txt =================================================================== --- trunk/quixote/doc/upgrading.txt 2004-11-29 21:57:41 UTC (rev 25681) +++ trunk/quixote/doc/upgrading.txt 2004-11-30 02:05:38 UTC (rev 25682) @@ -5,6 +5,63 @@ explains how to update application code to work with the newer version. +Changes from 1.0 to 2.0 +------------------------- + +Change any imports you have from quixote.form to be from quixote.form1. + +Change any imports you have from quixote.form2 to be from quixote.form. + +Replace '$' by '$$' in every literal in every template definition. + +Replace calls to HTTPRequest.get_form_var() with calls to get_field(). + +Define a create_publisher() function to get the publisher you need +and figure out how you want to connect it to web server. +See files in demo and server for examples. Note that publish1.py +contains a publisher that works more like the Quixote1 Publisher, +and does not require the changes listed below. + +Make every namespace be an instance of quixote.directory.Directory. +Update namespaces that are modules (or in the init.py of a package) by +defining a new class in the module that inherits from Directory and +moving your _q_exports and _q_* functions onto the class. Replace +"request" parameters with "self" parameters on the new methods. If +you have a _q_resolve method, include Resolving in the bases of your +new class. + +Remove request from calls to _q_ functions. If request, session, +user, path, or redirect is used in these new methods, replace as +needed with calls to get_request(), get_session(), get_user(), +get_path(), and/or redirect(), imported from quixote. + +In every namespace that formerly traversed into a module, import the +new Directory class from the module and create an instance of the +Directory in a variable whose name is the name of the module. + +In every namespace with a _q_exports and a _q_index, either add "" to +_q_exports or make sure that _q_lookup handles "" by returning the result +of a call to _q_index. + +If your code depends on the Publisher's namespace_stack attribute, +try using quixote.util.get_directory_path() instead. If you need the +namespace stack after the traversal, override Directory._q_traverse() +to call get_directory_path() when the end of the path is reached, and +record the result somewhere for later reference. + +If your code depends on _q_exception_handler, override the _q_traverse +on your root namespace or on your own Directory class to catch exceptions +and handle them the way you want. If you just want a general customization +for exception responses, you can change or override +Publisher.format_publish_error(). + +If your code depended on _q_access, include the AccessControlled with +the bases of your Directory classes as needed. + +Provide imports as needed to htmltext, TemplateIO, get_field, +get_request, get_session, get_user, get_path, redirect, ?. You may +find dulcinea/bin/unknown.py useful for identifying missing imports. + Changes from 0.6.1 to 1.0 -------------------------