sprox.iprovider

iprovider Module

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

Copyright © 2008 Christopher Perkins Original Version by Christopher Perkins 2008 Released under MIT license.

Classes

class sprox.iprovider.IProvider
create(entity, params)

Create an entry of type entity with the given params.

delete(entity, params)

Delete an entry of typeentity which matches the params.

get(entity, params)

Get a single entry of type entity which matches the params.

get_default_values(entity, params)

Get the default values for form filling based on the database schema.

get_dropdown_options(entity, field_name, view_names=None)

Get all dropdown options for a given entity field.

Arguments :
entity

the entity where the field is located

field_name

name of the field in the entity

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_fields(entity)

Get all of the fields for a given entity.

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)

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_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.

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.saormprovider

Next topic

sprox.widgets

This Page