equal
deleted
inserted
replaced
1 ================== |
1 =================== |
2 ZTFY.utils package |
2 pyams_utils package |
3 ================== |
3 =================== |
4 |
4 |
5 Introduction |
5 Introduction |
6 ------------ |
6 ------------ |
7 |
7 |
8 This package is composed of a set of utility functions, which in complement with zope.app.zapi |
8 This package is composed of a set of utility functions, usable into any Pyramid application. |
9 package can make Zope management easier. |
|
10 |
9 |
11 |
10 |
12 Unicode functions |
11 Unicode functions |
13 ----------------- |
12 ----------------- |
14 |
13 |
15 While working with extended characters sets containing accentuated characters, it's necessary to |
14 While working with extended characters sets containing accentuated characters, it's necessary to |
16 conversing strings to UTF8 so that they can be used without any conversion problem. |
15 convert strings to UTF8 so that they can be used without any conversion problem. |
17 |
16 |
18 >>> from pyams_utils import unicode |
17 >>> from pyams_utils import unicode |
19 |
18 |
20 'translate_string' is a utility function which can be used, for example, to generate an object's id |
19 'translate_string' is a utility function which can be used, for example, to generate an object's id |
21 without space and with accentuated characters converted to their unaccentuated version: |
20 without space and with accentuated characters converted to their unaccentuated version: |
126 |
125 |
127 |
126 |
128 Timezones handling |
127 Timezones handling |
129 ------------------ |
128 ------------------ |
130 |
129 |
131 Timezones handling game me headaches at first. I finally concluded that the best way (for me !) to handle |
130 Timezones handling gave me headaches at first. I finally concluded that the best way (for me !) to handle |
132 TZ data was to store every datetime value in GMT timezone. |
131 TZ data was to store every datetime value in GMT timezone. |
133 As far as I know, there is no easy way to know the user's timezone from his request settings. So you can: |
132 As far as I know, there is no easy way to know the user's timezone from his request settings. So you can: |
134 - store this timezone in user's profile, |
133 - store this timezone in user's profile, |
135 - define a static server's timezone |
134 - define a static server's timezone |
136 - create and register a ServerTimezoneUtility to handle server default timezone. |
135 - create and register a ServerTimezoneUtility to handle server default timezone. |