pydal.helpers package

Submodules

pydal.helpers.classes module

class pydal.helpers.classes.DatabaseStoredFile(db, filename, mode)[source]
close()[source]
close_connection()[source]
escape(obj)[source]
static exists(db, filename)[source]
read(bytes)[source]
readline()[source]
static try_create_web2py_filesystem(db)[source]
web2py_filesystems = set([])
write(data)[source]
class pydal.helpers.classes.MethodAdder(table)[source]

Bases: object

register(method_name=None)[source]
class pydal.helpers.classes.RecordDeleter(table, id)[source]

Bases: object

class pydal.helpers.classes.RecordUpdater(colset, table, id)[source]

Bases: object

class pydal.helpers.classes.Reference[source]

Bases: long

get(key, default=None)[source]
pydal.helpers.classes.Reference_pickler(data)[source]
pydal.helpers.classes.Reference_unpickler(data)[source]
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.SQLCallableList[source]

Bases: list

class pydal.helpers.classes.SQLCustomType(type='string', native=None, encoder=None, decoder=None, validator=None, _class=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) )
endswith(text=None)[source]
startswith(text=None)[source]
class pydal.helpers.classes.UseDatabaseStoredFile[source]
file_close(fileobj)[source]
file_delete(filename)[source]
file_exists(filename)[source]
file_open(filename, mode='rb', lock=True)[source]

pydal.helpers.methods module

pydal.helpers.methods.archive_record(qset, fs, archive_table, current_record)[source]
pydal.helpers.methods.auto_represent(field)[source]
pydal.helpers.methods.auto_validators(field)[source]
pydal.helpers.methods.bar_decode_integer(value)[source]
pydal.helpers.methods.bar_decode_string(value)[source]
pydal.helpers.methods.bar_encode(items)[source]
pydal.helpers.methods.bar_escape(item)[source]
pydal.helpers.methods.cleanup(text)[source]

Validates that the given text is clean: only contains [0-9a-zA-Z_]

pydal.helpers.methods.geoLine(*line)[source]
pydal.helpers.methods.geoPoint(x, y)[source]
pydal.helpers.methods.geoPolygon(*line)[source]
pydal.helpers.methods.hide_password(uri)[source]
pydal.helpers.methods.int2uuid(n)[source]
pydal.helpers.methods.list_represent(values, row=None)[source]
pydal.helpers.methods.pluralize(singular, rules=[(<_sre.SRE_Pattern object at 0x7fccd1d1a370>, <_sre.SRE_Pattern object at 0x7fccd1d1a370>, 'children'), (<_sre.SRE_Pattern object at 0x7fccd1d39030>, <_sre.SRE_Pattern object at 0x7fccd1d39030>, 'eet'), (<_sre.SRE_Pattern object at 0x7fccd2008ab0>, <_sre.SRE_Pattern object at 0x7fccd2008ab0>, 'eeth'), (<_sre.SRE_Pattern object at 0x7fccd2008b70>, <_sre.SRE_Pattern object at 0x7fccd1d1a440>, 'l\\1aves'), (<_sre.SRE_Pattern object at 0x7fccd1d390e0>, <_sre.SRE_Pattern object at 0x7fccd1d390e0>, 'ses'), (<_sre.SRE_Pattern object at 0x7fccd1d39190>, <_sre.SRE_Pattern object at 0x7fccd1d39190>, 'men'), (<_sre.SRE_Pattern object at 0x7fccd1d39240>, <_sre.SRE_Pattern object at 0x7fccd1d39240>, 'ives'), (<_sre.SRE_Pattern object at 0x7fccd1d392f0>, <_sre.SRE_Pattern object at 0x7fccd1d392f0>, 'eaux'), (<_sre.SRE_Pattern object at 0x7fccd1fab8f0>, <_sre.SRE_Pattern object at 0x7fccd1fab8f0>, 'lves'), (<_sre.SRE_Pattern object at 0x7fccd1d1a510>, <_sre.SRE_Pattern object at 0x7fccd1d1b9f0>, 'es'), (<_sre.SRE_Pattern object at 0x7fccd20759d0>, <_sre.SRE_Pattern object at 0x7fccd1d1ba58>, 'es'), (<_sre.SRE_Pattern object at 0x7fccd1fb68e8>, <_sre.SRE_Pattern object at 0x7fccd1f664b0>, 'ies'), (<_sre.SRE_Pattern object at 0x7fccd1d1ba58>, <_sre.SRE_Pattern object at 0x7fccd1d1ba58>, 's')])[source]
pydal.helpers.methods.smart_query(fields, text)[source]
pydal.helpers.methods.use_common_filters(query)[source]
pydal.helpers.methods.uuid2int(uuidv)[source]
pydal.helpers.methods.varquote_aux(name, quotestr='%s')[source]
pydal.helpers.methods.xorify(orderby)[source]

pydal.helpers.regex module

Module contents