pydal.helpers package

Submodules

pydal.helpers.classes module

class pydal.helpers.classes.BasicStorage(*args, **kwargs)[source]

Bases: object

clear(*args, **kwargs)
copy(*args, **kwargs)
get(key, default=None)[source]
has_key(key)
items()[source]
iteritems()[source]
iterkeys()[source]
itervalues()[source]
keys()[source]
pop(*args, **kwargs)
update(*args, **kwargs)[source]
values()[source]
class pydal.helpers.classes.ConnectionConfigurationMixin[source]

Bases: object

class pydal.helpers.classes.DatabaseStoredFile(db, filename, mode)[source]
close()[source]
close_connection()[source]
escape(obj)[source]
static exists(db, filename)[source]
static is_operational_error(db, error)[source]
static is_programming_error(db, error)[source]
read(bytes=None)[source]
readline()[source]
static try_create_web2py_filesystem(db)[source]
web2py_filesystems = set([])
write(data)[source]
class pydal.helpers.classes.ExecutionHandler(adapter)[source]

Bases: object

after_execute(command)[source]
before_execute(command)[source]
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.

https://www.python.org/dev/peps/pep-0249/

warn_bad_usage(attr)[source]
class pydal.helpers.classes.FakeDriver(*args, **kwargs)[source]

Bases: pydal.helpers.classes.BasicStorage

close()[source]
commit()[source]
cursor()[source]
class pydal.helpers.classes.MethodAdder(table)[source]

Bases: object

register(method_name=None)[source]
class pydal.helpers.classes.NullCursor[source]

Bases: pydal.helpers.classes.FakeCursor

lastrowid = 1
class pydal.helpers.classes.NullDriver(*args, **kwargs)[source]

Bases: pydal.helpers.classes.FakeDriver

class pydal.helpers.classes.OpRow(table)[source]

Bases: object

del_value(key)[source]
get(key, default=None)[source]
items()[source]
iteritems()[source]
iterkeys()[source]
itervalues()[source]
keys()[source]
op_values()[source]
set_value(key, value, field=None)[source]
values()[source]
class pydal.helpers.classes.RecordDeleter(colset, table, id)[source]

Bases: pydal.helpers.classes.RecordOperator

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

Bases: object

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

Bases: pydal.helpers.classes.RecordOperator

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, 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) )
endswith(text=None)[source]
startswith(text=None)[source]
class pydal.helpers.classes.Serializable[source]

Bases: object

as_dict(flat=False, sanitize=True)[source]
as_json(sanitize=True)[source]
as_xml(sanitize=True)[source]
as_yaml(sanitize=True)[source]
class pydal.helpers.classes.TimingHandler(adapter)[source]

Bases: pydal.helpers.classes.ExecutionHandler

MAXSTORAGE = 100
after_execute(command)[source]
before_execute(command)[source]
timings
class pydal.helpers.classes.cachedprop(fget, doc=None)[source]

Bases: object

pydal.helpers.classes.pickle_basicstorage(s)[source]

pydal.helpers.methods module

pydal.helpers.methods.archive_record(qset, fs, archive_table, current_record)[source]
pydal.helpers.methods.attempt_upload(table, fields)[source]
pydal.helpers.methods.attempt_upload_on_insert(table)[source]
pydal.helpers.methods.attempt_upload_on_update(table)[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.bar_unescape(item)[source]
pydal.helpers.methods.cleanup(text)[source]

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

pydal.helpers.methods.delete_uploaded_files(dbset, upload_fields=None)[source]
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.merge_tablemaps(*maplist)[source]

Merge arguments into a single dict, check for name collisions.

pydal.helpers.methods.pluralize(singular, rules=[(<_sre.SRE_Pattern object>, <_sre.SRE_Pattern object>, 'children'), (<_sre.SRE_Pattern object>, <_sre.SRE_Pattern object>, 'eet'), (<_sre.SRE_Pattern object>, <_sre.SRE_Pattern object>, 'eeth'), (<_sre.SRE_Pattern object>, <_sre.SRE_Pattern object>, 'l\\1aves'), (<_sre.SRE_Pattern object>, <_sre.SRE_Pattern object>, 'ses'), (<_sre.SRE_Pattern object>, <_sre.SRE_Pattern object>, 'men'), (<_sre.SRE_Pattern object>, <_sre.SRE_Pattern object>, 'ives'), (<_sre.SRE_Pattern object>, <_sre.SRE_Pattern object>, 'eaux'), (<_sre.SRE_Pattern object>, <_sre.SRE_Pattern object>, 'lves'), (<_sre.SRE_Pattern object>, <_sre.SRE_Pattern object>, 'es'), (<_sre.SRE_Pattern object>, <_sre.SRE_Pattern object>, 'es'), (<_sre.SRE_Pattern object>, <_sre.SRE_Pattern object>, 'ies'), (<_sre.SRE_Pattern object>, <_sre.SRE_Pattern object>, '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