module documentation

_globals.py - ZMS Global Constants and Utilities

This module defines global constants and utility classes used throughout the ZMS product, including datatype constants (DT_*), a static page template wrapper, a generic attribute container (MyClass), and a section-numbering helper (MySectionizer).

License: GNU General Public License v2 or later, Organization: ZMS Publishing

Class MyClass Generic attribute container that exposes its instance attributes via a keys() method, similar to a dictionary.
Class MySectionizer Helper class for generating hierarchical section numbers (e.g. '1.2.3.') with support for different numbering formats (numeric, uppercase, lowercase).
Class StaticPageTemplateFile A PageTemplateFile subclass that allows injecting a custom context and options dictionary into the template rendering environment.
Function datatype_key Return the integer key for a given datatype name.
Function get_size Returns size of given object v in bytes.
Constant DT_AMOUNT Undocumented
Constant DT_BLOBS Undocumented
Constant DT_BOOLEAN Undocumented
Constant DT_DATE Undocumented
Constant DT_DATETIME Undocumented
Constant DT_DATETIMES Undocumented
Constant DT_DICT Undocumented
Constant DT_FILE Undocumented
Constant DT_FLOAT Undocumented
Constant DT_ID Undocumented
Constant DT_IMAGE Undocumented
Constant DT_INT Undocumented
Constant DT_INTS Undocumented
Constant DT_LIST Undocumented
Constant DT_NUMBERS Undocumented
Constant DT_PASSWORD Undocumented
Constant DT_STRING Undocumented
Constant DT_STRINGS Undocumented
Constant DT_TEXT Undocumented
Constant DT_TEXTS Undocumented
Constant DT_TIME Undocumented
Constant DT_UNKNOWN Undocumented
Constant DT_URL Undocumented
Constant DT_XML Undocumented
Variable datatype_map Undocumented
def datatype_key(datatype): (source)

Return the integer key for a given datatype name.

Parameters
datatype:strDatatype name (e.g. 'string', 'int', 'image')
Returns
intInteger datatype key, or DT_UNKNOWN if not found
def get_size(v): (source)

Returns size of given object v in bytes.

Returns
intSize in bytes
DT_AMOUNT: int = (source)

Undocumented

Value
17
DT_BLOBS = (source)

Undocumented

Value
[DT_IMAGE, DT_FILE]
DT_BOOLEAN: int = (source)

Undocumented

Value
1
DT_DATE: int = (source)

Undocumented

Value
2
DT_DATETIME: int = (source)

Undocumented

Value
3
DT_DATETIMES = (source)

Undocumented

Value
[DT_DATE, DT_TIME, DT_DATETIME]
DT_DICT: int = (source)

Undocumented

Value
4
DT_FILE: int = (source)

Undocumented

Value
5
DT_FLOAT: int = (source)

Undocumented

Value
6
DT_ID: int = (source)

Undocumented

Value
15
DT_IMAGE: int = (source)

Undocumented

Value
7
DT_INT: int = (source)

Undocumented

Value
8

Undocumented

Value
[DT_INT, DT_BOOLEAN]
DT_LIST: int = (source)

Undocumented

Value
9
DT_NUMBERS = (source)

Undocumented

Value
[DT_INT, DT_FLOAT, DT_AMOUNT]
DT_PASSWORD: int = (source)

Undocumented

Value
10
DT_STRING: int = (source)

Undocumented

Value
11
DT_STRINGS = (source)

Undocumented

Value
[DT_STRING, DT_TEXT, DT_URL, DT_PASSWORD, DT_XML]
DT_TEXT: int = (source)

Undocumented

Value
12
DT_TEXTS = (source)

Undocumented

Value
[DT_STRING, DT_TEXT]
DT_TIME: int = (source)

Undocumented

Value
13
DT_UNKNOWN: int = (source)

Undocumented

Value
0
DT_URL: int = (source)

Undocumented

Value
14
DT_XML: int = (source)

Undocumented

Value
16
datatype_map: list = (source)

Undocumented