Mercurial > p > roundup > code
comparison doc/upgrading.txt @ 2907:bcb4668d4196
more docs
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Fri, 12 Nov 2004 04:27:00 +0000 |
| parents | accb3b411ef6 |
| children | 5c0e5abcb5e3 |
comparison
equal
deleted
inserted
replaced
| 2906:a8808157f892 | 2907:bcb4668d4196 |
|---|---|
| 28 | 28 |
| 29 Class.safeget() was removed from the API. Test your item ids before calling | 29 Class.safeget() was removed from the API. Test your item ids before calling |
| 30 Class.get() instead. | 30 Class.get() instead. |
| 31 | 31 |
| 32 | 32 |
| 33 0.8.0 new tracker layout | 33 0.8.0 New tracker layout |
| 34 ------------------------ | 34 ------------------------ |
| 35 | |
| 36 XXX describe any mandatory changes to tracker layout | |
| 37 | 35 |
| 38 The ``config.py`` file has been replaced by ``config.ini``. You may use the | 36 The ``config.py`` file has been replaced by ``config.ini``. You may use the |
| 39 roundup-admin command "genconfig" to generate a new config file:: | 37 roundup-admin command "genconfig" to generate a new config file:: |
| 40 | 38 |
| 41 roundup-admin genconfig <tracker home>/config.ini | 39 roundup-admin genconfig <tracker home>/config.ini |
| 81 ``interfaces.py`` file will be ignored in future versions of Roundup. See | 79 ``interfaces.py`` file will be ignored in future versions of Roundup. See |
| 82 the `what's new in 0.8`__ documentation for more information. | 80 the `what's new in 0.8`__ documentation for more information. |
| 83 | 81 |
| 84 __ whatsnew-0.8.html | 82 __ whatsnew-0.8.html |
| 85 | 83 |
| 86 0.8.0 8-bit character set support | 84 |
| 87 --------------------------------- | 85 0.8.0 Permissions Changes |
| 88 | 86 ------------------------- |
| 89 Added support for custom encodings in http data. | 87 |
| 90 | 88 The creation of a new item in the user interfaces is now controlled by the |
| 91 Inside Roundup, all strings are stored and processed in utf-8. | 89 "Create" Permission. You will need to add an assignment of this Permission |
| 92 Unfortunately, some older browsers do not work properly with | 90 to your users who are allowed to create items. The most common form of this |
| 93 utf8-encoded pages (e.g. Netscape Navigator 4 displays wrong | 91 is the following in your ``schema.py`` added just under the current |
| 94 characters in form fields). This version allows to change | 92 assignation of the Edit Permission:: |
| 95 the character set for http transfers. To do so, you may add | 93 |
| 96 the following code to your ``page.html`` template:: | 94 for cl in 'issue', 'file', 'msg', 'query', 'keyword': |
| 97 | 95 p = db.security.getPermission('Create', cl) |
| 98 <tal:block define="uri string:${request/base}${request/env/PATH_INFO}"> | 96 db.security.addPermissionToRole('User', p) |
| 99 <a tal:attributes="href python:request.indexargs_href(uri, | 97 |
| 100 {'@charset':'utf-8'})">utf-8</a> | 98 You will need to explicitly let anonymous users access the web interface so |
| 101 <a tal:attributes="href python:request.indexargs_href(uri, | 99 that regular users are able to see the login form. Note that almost all |
| 102 {'@charset':'koi8-r'})">koi8-r</a> | 100 trackers will need this Permission. The only situation where it's not |
| 103 </tal:block> | 101 required is in a tracker that uses an HTTP Basic Authenticated front-end. |
| 104 | 102 It's enabled by adding to your ``schema.py``:: |
| 105 (substitute ``koi8-r`` with appropriate charset for your language). | 103 |
| 106 Charset preference is kept in the browser cookie ``roundup_charset``. | 104 p = db.security.getPermission('Web Access') |
| 107 | 105 db.security.addPermissionToRole('Anonymous', p) |
| 108 Lines ``meta http-equiv`` added to the tracker templates in version 0.6.0 | 106 |
| 109 should be changed to include actual character set name:: | 107 Finally, you will need to enable permission for your users to edit their |
| 110 | 108 own details by adding the following to ``schema.py``:: |
| 111 <meta http-equiv="Content-Type" | 109 |
| 112 tal:attributes="content string:text/html;; charset=${request/client/charset}" | 110 # Users should be able to edit their own details. Note that this |
| 113 /> | 111 # permission is limited to only the situation where the Viewed or |
| 114 | 112 # Edited item is their own. |
| 115 Actual charset is also sent in the http header. | 113 def own_record(db, userid, itemid): |
| 114 '''Determine whether the userid matches the item being accessed.''' | |
| 115 return userid == itemid | |
| 116 p = db.security.addPermission(name='View', klass='user', check=own_record, | |
| 117 description="User is allowed to view their own user details") | |
| 118 p = db.security.addPermission(name='Edit', klass='user', check=own_record, | |
| 119 description="User is allowed to edit their own user details") | |
| 120 db.security.addPermissionToRole('User', p) | |
| 121 | |
| 122 | |
| 123 0.8.0 Use of TemplatingUtils | |
| 124 ---------------------------- | |
| 125 | |
| 126 If you used custom python functions in TemplatingUtils, they need to | |
| 127 be moved from interfaces.py to a new file in the ``extensions`` directory. | |
| 128 Each Function that should be available through TAL needs to be defined | |
| 129 as a toplevel function in the newly created file. Furthermore you | |
| 130 add an inititialization function, that registers the functions with the | |
| 131 tracker. | |
| 132 | |
| 133 If you find this too tedious, donfu wrote an automatic init function that | |
| 134 takes an existing TemplatingUtils class, and registers all class methods | |
| 135 that do not start with an underscore. The following hack should be placed | |
| 136 in the ``extensions`` directory alongside other extensions:: | |
| 137 | |
| 138 class TemplatingUtils: | |
| 139 # copy from interfaces.py | |
| 140 | |
| 141 def init(tracker): | |
| 142 util = TemplatingUtils() | |
| 143 | |
| 144 def setClient(tu): | |
| 145 util.client = tu.client | |
| 146 return util | |
| 147 | |
| 148 def execUtil(name): | |
| 149 return lambda tu, *args, **kwargs: \ | |
| 150 getattr(setClient(tu), name)(*args, **kwargs) | |
| 151 | |
| 152 for name in dir(util): | |
| 153 if callable(getattr(util, name)) and not name.startswith('_'): | |
| 154 tracker.registerUtil(name, execUtil(name)) | |
| 155 | |
| 116 | 156 |
| 117 0.8.0 Logging Configuration | 157 0.8.0 Logging Configuration |
| 118 --------------------------- | 158 --------------------------- |
| 119 | 159 |
| 120 See the `administration guide`_ for information about configuring the new | 160 See the `administration guide`_ for information about configuring the new |
