sprox.mg.provider

mingprovider Module

This contains the class which allows sprox to interface with any database.

Copyright &copy 2009 Jorge Vargas Original Version by Jorge Vargas 2009 Released under MIT license.

Classes

class sprox.mg.provider.MingProvider(hint, **hints)

Bases: sprox.iprovider.IProvider

create(entity, params)

Create an entry of type entity with the given params.

default_validator_selector_type

alias of MingValidatorSelector

default_widget_selector_type

alias of MingWidgetSelector

delete(entity, params)

Delete an entry of typeentity which matches the params.

dictify(obj, fields=None, omit_fields=None)
flush()
get(entity, params, fields=None, omit_fields=None)
get_default_values(entity, params)
get_dropdown_options(entity_or_field, field_name, view_names=None)

Get all dropdown options for a given entity field.

Arguments :
entity_or_field

either the entity where the field is located, or the field itself

field_name

if the entity is specified, name of the field in the entity. Otherwise, None

view_names

a list of names which define what the view field may contain. This allows the first field that has a name in the list of names will be returned as the view field.

Returns :

A list of tuples with (id, view_value) as items.

get_entities()

Get all entities available for this provider.

get_entity(name)

Get an entity with the given name.

get_field(entity, name)

Get a field with the given field name.

get_field_default(field)
get_field_provider_specific_widget_args(entity, field, field_name)
get_field_widget_args(entity, field_name, field)
get_fields(entity)

Get all of the fields for a given entity.

get_obj(entity, params, fields=None, omit_fields=None)
get_primary_field(entity)

Get the single primary field for an entity

get_primary_fields(entity)

Get the fields in the entity which uniquely identifies a record.

get_relations(entity)

Get all of the field names in an enity which are related to other entities.

get_view_field_name(entity, possible_names=None)

Get the name of the field which first matches the possible colums

Arguments :
entity

the entity where the field is located

possible_names

a list of names which define what the view field may contain. This allows the first field that has a name in the list of names will be returned as the view field.

is_binary(entity, name)
is_nullable(entity, field_name)

Determine if a field is nullable.

is_relation(entity, field_name)

Determine if a field is related to a field in another entity.

is_unique(entity, field_name, value)
is_unique_field(entity, field_name)
query(entity, limit=None, offset=0, limit_fields=None, order_by=None, desc=False, filters={}, **kw)
relation_entity(entity, field_name)

If the field in the entity is a relation field, then returns the entity which it relates to.

Returns :Related entity for the field
relation_fields(entity, field_name)
update(entity, params)

Update an entry of type entity which matches the params.

Discuss

blog comments powered by Disqus

Table Of Contents

Previous topic

sprox.sa.validatorselector

Next topic

sprox.mg.widgetselector

This Page