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(item)¶
- pop(*args, **kwargs)¶
- class pydal.helpers.classes.DatabaseStoredFile(db, filename, mode)[source]¶
-
- web2py_filesystems = set([])¶
- 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) )
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.pluralize(singular, rules=[(<_sre.SRE_Pattern object at 0x7f384bf37b90>, <_sre.SRE_Pattern object at 0x7f384bf37b90>, 'children'), (<_sre.SRE_Pattern object at 0x7f384bf63f50>, <_sre.SRE_Pattern object at 0x7f384bf63f50>, 'eet'), (<_sre.SRE_Pattern object at 0x7f384befe270>, <_sre.SRE_Pattern object at 0x7f384befe270>, 'eeth'), (<_sre.SRE_Pattern object at 0x7f384befe330>, <_sre.SRE_Pattern object at 0x7f384bf37c60>, 'l\\1aves'), (<_sre.SRE_Pattern object at 0x7f3848ba7030>, <_sre.SRE_Pattern object at 0x7f3848ba7030>, 'ses'), (<_sre.SRE_Pattern object at 0x7f3848ba70e0>, <_sre.SRE_Pattern object at 0x7f3848ba70e0>, 'men'), (<_sre.SRE_Pattern object at 0x7f3848ba7190>, <_sre.SRE_Pattern object at 0x7f3848ba7190>, 'ives'), (<_sre.SRE_Pattern object at 0x7f3848ba7240>, <_sre.SRE_Pattern object at 0x7f3848ba7240>, 'eaux'), (<_sre.SRE_Pattern object at 0x7f3848cd4030>, <_sre.SRE_Pattern object at 0x7f3848cd4030>, 'lves'), (<_sre.SRE_Pattern object at 0x7f384bf37d30>, <_sre.SRE_Pattern object at 0x7f38493d9850>, 'es'), (<_sre.SRE_Pattern object at 0x7f384bf4a8f0>, <_sre.SRE_Pattern object at 0x7f38493d9850>, 'es'), (<_sre.SRE_Pattern object at 0x7f384bef19e0>, <_sre.SRE_Pattern object at 0x7f3848b80b70>, 'ies'), (<_sre.SRE_Pattern object at 0x7f38493d9850>, <_sre.SRE_Pattern object at 0x7f38493d9850>, 's')])[source]¶