pydal.helpers package¶
Submodules¶
pydal.helpers.classes module¶
-
class
pydal.helpers.classes.
BasicStorage
(*args, **kwargs)[source]¶ Bases:
object
-
clear
(*args, **kwargs)¶
-
copy
(*args, **kwargs)¶
-
has_key
(key)¶
-
pop
(*args, **kwargs)¶
-
-
class
pydal.helpers.classes.
DatabaseStoredFile
(db, filename, mode)[source]¶ -
-
web2py_filesystems
= set([])¶
-
-
class
pydal.helpers.classes.
FakeCursor
[source]¶ Bases:
object
The Python Database API Specification has a cursor() method, which NoSql drivers generally don’t support. If the exception in this function is taken then it likely means that some piece of functionality has not yet been implemented in the driver. And something is using the cursor.
-
class
pydal.helpers.classes.
NullCursor
[source]¶ Bases:
pydal.helpers.classes.FakeCursor
-
lastrowid
= 1¶
-
-
class
pydal.helpers.classes.
SQLALL
(table)[source]¶ Bases:
object
Helper class providing a comma-separated string having all the field names (prefixed by table name and ‘.’)
normally only called from within gluon.dal
-
class
pydal.helpers.classes.
SQLCustomType
(type='string', native=None, encoder=None, decoder=None, validator=None, _class=None, widget=None, represent=None)[source]¶ Bases:
object
Allows defining of custom SQL types
Parameters: - type – the web2py type (default = ‘string’)
- native – the backend type
- encoder – how to encode the value to store it in the backend
- decoder – how to decode the value retrieved from the backend
- validator – what validators to use ( default = None, will use the default validator for type)
- Example::
Define as:
- decimal = SQLCustomType(
- type =’double’, native =’integer’, encoder =(lambda x: int(float(x) * 100)), decoder = (lambda x: Decimal(“0.00”) + Decimal(str(float(x)/100)) ) )
- db.define_table(
- ‘example’, Field(‘value’, type=decimal) )
-
class
pydal.helpers.classes.
TimingHandler
(adapter)[source]¶ Bases:
pydal.helpers.classes.ExecutionHandler
-
MAXSTORAGE
= 100¶
-
timings
¶
-
pydal.helpers.methods module¶
-
pydal.helpers.methods.
cleanup
(text)[source]¶ Validates that the given text is clean: only contains [0-9a-zA-Z_]
-
pydal.helpers.methods.
merge_tablemaps
(*maplist)[source]¶ Merge arguments into a single dict, check for name collisions. Arguments may be modified in the process.
-
pydal.helpers.methods.
pluralize
(singular, rules=[(<_sre.SRE_Pattern object at 0x7fad7c0aa6b0>, <_sre.SRE_Pattern object at 0x7fad7c0aa6b0>, 'children'), (<_sre.SRE_Pattern object at 0x7fad7c073d40>, <_sre.SRE_Pattern object at 0x7fad7c073d40>, 'eet'), (<_sre.SRE_Pattern object at 0x7fad7c0b6b70>, <_sre.SRE_Pattern object at 0x7fad7c0b6b70>, 'eeth'), (<_sre.SRE_Pattern object at 0x7fad7c0b6c30>, <_sre.SRE_Pattern object at 0x7fad7c0aa780>, 'l\\1aves'), (<_sre.SRE_Pattern object at 0x7fad7c073df0>, <_sre.SRE_Pattern object at 0x7fad7c073df0>, 'ses'), (<_sre.SRE_Pattern object at 0x7fad7c073ea0>, <_sre.SRE_Pattern object at 0x7fad7c073ea0>, 'men'), (<_sre.SRE_Pattern object at 0x7fad7c073f50>, <_sre.SRE_Pattern object at 0x7fad7c073f50>, 'ives'), (<_sre.SRE_Pattern object at 0x7fad7beb0030>, <_sre.SRE_Pattern object at 0x7fad7beb0030>, 'eaux'), (<_sre.SRE_Pattern object at 0x7fad7c0a6d50>, <_sre.SRE_Pattern object at 0x7fad7c0a6d50>, 'lves'), (<_sre.SRE_Pattern object at 0x7fad7c0aa850>, <_sre.SRE_Pattern object at 0x7fad7c6bad30>, 'es'), (<_sre.SRE_Pattern object at 0x7fad7c07f3b0>, <_sre.SRE_Pattern object at 0x7fad7c6bad30>, 'es'), (<_sre.SRE_Pattern object at 0x7fad7c04c318>, <_sre.SRE_Pattern object at 0x7fad7bfc2d20>, 'ies'), (<_sre.SRE_Pattern object at 0x7fad7c6bad30>, <_sre.SRE_Pattern object at 0x7fad7c6bad30>, 's')])[source]¶