TikiBuilder Module

Module usedto build a ZODB that will be used by the TikiWare WebApp Framework

class TikiBuilder.Builder(db)

Main class to be used to create the database. requires a tikiDB.DB to be passed. All methods that commit data must be explicitly committed by transaction.commit() after being performed.

create_container(name, rebuild=False)

creates a containter to house data objects and adds an object to the index_listing container

Parameters:name (String) – The name of the conainter to be created. should be a plural of the object (i.e. people for an container to house person objects, recipies for a container to house recipe objects, etc...)
create_object_definition(obj_name, obj_container, obj_fields, obj_desc, version_number=1.0, version_date=None)

creates the data definition of an object. the name of the object definition should be a singular object.

Parameters:
  • obj_name (String) – name of the object for which the definition will be created
  • obj_fields (Dict) – dictionary of required fields. The key is name of field value is the data type stored. if blank any data is accepted
  • obj_desc (String) – a brief description of the object
  • version_number (Float) – the revision of the object. this should be incremented for every change there is to an object definition to allow for updating of the object
  • version_date (String (formated in standard python datetime)) – the date of the version. if None it becomes the current date
Paramobj_container :
 

name of the container where the objects will be stored

generateDatabaseDocs(doc_type='markdown')

generate database document. this will contain information on the containers, objects and indexes that are available in the database :param doc_type: is the type data returned. valid types are: markdown, html, print: pretty print? :type doc_type: string

getContainers()

return a list of all containers

getIndexes()

Return a list of all indexes

getObjectDefinitions()

Return a dict of the object definitions

makeIndex(index_name, index_type, index_container, index_field, index_description, reindex=False)

calls the makeIndex method of the passed TikiDB.DB() to create an index. Refer to the doc string of the TikiDB.DB.makeIndex() for more info

class TikiBuilder.Builder(db)

Main class to be used to create the database. requires a tikiDB.DB to be passed. All methods that commit data must be explicitly committed by transaction.commit() after being performed.

create_container(name, rebuild=False)

creates a containter to house data objects and adds an object to the index_listing container

Parameters:name (String) – The name of the conainter to be created. should be a plural of the object (i.e. people for an container to house person objects, recipies for a container to house recipe objects, etc...)
create_object_definition(obj_name, obj_container, obj_fields, obj_desc, version_number=1.0, version_date=None)

creates the data definition of an object. the name of the object definition should be a singular object.

Parameters:
  • obj_name (String) – name of the object for which the definition will be created
  • obj_fields (Dict) – dictionary of required fields. The key is name of field value is the data type stored. if blank any data is accepted
  • obj_desc (String) – a brief description of the object
  • version_number (Float) – the revision of the object. this should be incremented for every change there is to an object definition to allow for updating of the object
  • version_date (String (formated in standard python datetime)) – the date of the version. if None it becomes the current date
Paramobj_container :
 

name of the container where the objects will be stored

generateDatabaseDocs(doc_type='markdown')

generate database document. this will contain information on the containers, objects and indexes that are available in the database :param doc_type: is the type data returned. valid types are: markdown, html, print: pretty print? :type doc_type: string

getContainers()

return a list of all containers

getIndexes()

Return a list of all indexes

getObjectDefinitions()

Return a dict of the object definitions

makeIndex(index_name, index_type, index_container, index_field, index_description, reindex=False)

calls the makeIndex method of the passed TikiDB.DB() to create an index. Refer to the doc string of the TikiDB.DB.makeIndex() for more info

Previous topic

TikiDB Module

This Page