tba.
Module will load a dictionary (allAssets) holding the link between Module-Name and Class. It can be used to automatically create different assets
the dataElement-class is the base-class for any data-type stored in the data-base. It has functionality to gather a unique ID for the object loading up versions which were stored in the data-base before, publish(save) an object in the data-base and manage the version contol of an object.
DataElement has an OrderedDict instance-variable -called assetDict-, which stores all properties and settings of the current object, which should be stored in the database. In addition to that DataElement creates for each entry in this dictionary two instance-methods called DataElement.[ATTRIBUTE-NAME] and DataElement.set_[ATTRIBUTE-NAME], which can be used to change the values of the attributes.
InObjects, which are derived by DataElement the assetDict can be extended by using the instance-variable: DataElement.additionalAssetDict
To load an object which is derived by DataElement and was stored in the database before, it is possible to use the DataElement.fromAssetDict classmethod.
with this Dict the __mandatoryAssetDict can be extended in derived classes
This method can be reimplemented in case the derived class needs to add additional steps to load up the Node
classmethod will return an instance the object, which is stored in the database, which matches to the given Id and will set all it’s attributes according to the given assetDict
Parameters: |
|
---|---|
Returns: | a new instance of the class, which matches the type-attribute in the assetDict |
Return type: | DataElement |
returns the assetDict of this Node
Returns: | assetDict instance variable |
---|---|
Return type: | dictionary |
this method can be reimplemented in case the Node has to be setup after publishing is done
Parameters: | recursive (bool) – indicates if the publish call should recursevely call all childNodes as well |
---|
this method can be reimplemented in case the Node has to be setup before publishing it to the dataBase
Parameters: | recursive (bool) – indicates if the publish call should recursevely call all childNodes as well |
---|
this method will publish the current Node with all its settings to the dataBase in a new generated version. if derived classes need to setup the attributes in any way, before and/or after publishing, the two functions prePublish and postPublish can be reimplemented!
Parameters: | recursive (bool) – indicates if the publish should go though all children of this node as well |
---|
method will change a property in the assetDict directly, without using the generated lambda-functions
Parameters: |
|
---|---|
Returns: | the updated assetDict |
Return type: | dictionary |
method will iter over each key of a given attribute and assign its value to the assetDict of the given instance
Parameters: |
|
---|
method will setup the instance-methods, which are needed to set, get or delete values in the self.assetDict instance-variable for each attribute stored in the assetDict instance-variable the will be the following functions generated: setter-> set_ATTRIBUTENAME(value) getter-> ATTRIBUTENAME() deleter-> del_ATTRIBUTENAME()
AbstractAsset is derived by DataElement and is therefore a Node which can be published and version-controled.
AbstractAsset has functionality to connect to other Nodes and assigning a user to it.
Each AbstractAsset gas an extended assetDict compared to the default mandatoryAssetDict of DataElement
method will update the _inputDict instance variable, which holds a key for each possible connection and assigns a list to it, which can be filled as soon as a connected asset can use a connection
Parameters: | connectionName (string) – classname of the desired connection-types |
---|---|
Returns: | the _inputDict instance variable |
Return type: | dictionary |
similar to setOutput but instead of a list, this function takes a single string
Parameters: | connectionName (string) – class-name of the connection-object, which should be appended |
---|---|
Returns: | _outputList instance variable |
Return type: | list of AbstractConnection |
this method is a reimplementment of DataElement to be able to set the possible connections correctly
method will assign a user to this asset
Parameters: | user (User) – user who should be assigned to this asset |
---|
connects a node to another AbstractAsset derived Node
Parameters: | asset (AbstractAsset) – Node, which should become a dependency of this Node. |
---|
will return the first item in the outputList as default output
Returns: | the first item of all outputs and None if _outputList is empty |
---|---|
Return type: | None or AbstractConnection |
method disconnects a given asset from this Node :param asset: Node, which should be disconnected :type asset: AbstractAsset
classmethod will return an instance the object, which is stored in the database, which matches to the given Id and will set all it’s attributes according to the given assetDict
Parameters: |
|
---|---|
Returns: | a new instance of the class, which matches the type-attribute in the assetDict |
Return type: | DataElement |
method will return the _inputDict instance variable
Returns: | _inputDict instance variable |
---|---|
Return type: | dictionary |
method will return the _outputList instance variable
Returns: | _outputList instance variable |
---|---|
Return type: | list of AbstractConnection |
returns the assetDict of this Node
Returns: | assetDict instance variable |
---|---|
Return type: | dictionary |
this method calculates the urgency of this asset by comparing the state() attribute to the start_date() and end_date() attribute and setting these attributes in relation to the current date
Returns: | state as -1=not urgent, 0=moderately urgent, 1=urgent, 2=highest priority |
---|---|
Return type: | int |
method will list all objects which are dependencies of this Node :param recursive: indicates if only teh direct dependencies(False, default) should be listed or even the indirect dependencies (dependencies of dependencies) :type recursive: bool
Returns: | a list of AbstractAsset-derivates |
---|---|
Return type: | list |
get a certain entry in the _inputDict instance variable
Parameters: | connectionName (string) – classname of the AbstractConnection-class which should be returned |
---|---|
Returns: | list of connected AbstractConnection objects |
Return type: | list of AbstractConnection |
method will search recursively for the connected project-Node
Returns: | the project-node connected to this node |
---|---|
Return type: | Project |
method will search recursively for the connected project-Node
Returns: | the project-node connected to this node |
---|---|
Return type: | Project |
method will return if this asset is scheduled at the given date
Parameters: | date (datetime.datetime) – the date which is to be checked |
---|---|
Returns: | if this asset is scheduled at the given date |
Return type: | boolean |
function is a reimplementment of the postPublish function of DataElement for more information to switch back the baseId in user() to a user-object
function is a reimplementment of the prePublish function of DataElement for more information to switch the user -object to a baseId object
this method will publish the current Node with all its settings to the dataBase in a new generated version. if derived classes need to setup the attributes in any way, before and/or after publishing, the two functions prePublish and postPublish can be reimplemented!
Parameters: | recursive (bool) – indicates if the publish should go though all children of this node as well |
---|
remove a connection from the _inputDict instance variable :param connectionName: classname of the AbstractConnection-class which should be deleted :type connectionName: string
Returns: | _inputDict |
---|---|
Return type: | dictionary |
method will remove one entry from the _inputDict instance variable
Parameters: | connectionName (string) – classname of the desired connection-types |
---|---|
Returns: | the _inputDict instance variable |
Return type: | dictionary |
will remove a given connection instance from the _outputList
Parameters: | connection (AbstractConnection) – connection-object |
---|
removes a certain connectionInstance from the _outputList instance variable
Parameters: | connectionName (string) – class-name of the connection-object, which should be appended |
---|---|
Returns: | _outputList instance variable |
Return type: | list of AbstractConnection |
adds a connection-Object to the _inputDict instance variable of this Node this will in the end define if two Nodes are connected or not.
Parameters: | connection (AbstractConnection) – connection-object |
---|---|
Returns: | returns a success-boolean |
Return type: | bool |
method will update the _inputDict instance variable, which holds a key for each possible connection and assigns a list to it, which can be filled as soon as a connected asset can use a connection
Parameters: | connectionNameList (list of strings) – list of the classnames of the desired connection-types |
---|---|
Returns: | the _inputDict instance variable |
Return type: | dictionary |
similar to setInputTypes but it will add for each entry in connectionNameList a connection-object-instance which can be used for connecting later on
Parameters: | connectionNameList (list) – list of class-name sof the connection-objects, which should be appended |
---|---|
Returns: | _outputList instance variable |
Return type: | list of AbstractConnection |
method will change a property in the assetDict directly, without using the generated lambda-functions
Parameters: |
|
---|---|
Returns: | the updated assetDict |
Return type: | dictionary |
method will iter over each key of a given attribute and assign its value to the assetDict of the given instance
Parameters: |
|
---|
method will setup the instance-methods, which are needed to set, get or delete values in the self.assetDict instance-variable for each attribute stored in the assetDict instance-variable the will be the following functions generated: setter-> set_ATTRIBUTENAME(value) getter-> ATTRIBUTENAME() deleter-> del_ATTRIBUTENAME()
AbstractGroup is derived by AbstractAsset and defines a groupAsset
group assets have the special behaviour, that their timespan as well as their user is the sum of all dependent nodes.
method will update the _inputDict instance variable, which holds a key for each possible connection and assigns a list to it, which can be filled as soon as a connected asset can use a connection
Parameters: | connectionName (string) – classname of the desired connection-types |
---|---|
Returns: | the _inputDict instance variable |
Return type: | dictionary |
similar to setOutput but instead of a list, this function takes a single string
Parameters: | connectionName (string) – class-name of the connection-object, which should be appended |
---|---|
Returns: | _outputList instance variable |
Return type: | list of AbstractConnection |
this method is a reimplementment of DataElement to be able to set the possible connections correctly
method will assign a user to this asset
Parameters: | user (User) – user who should be assigned to this asset |
---|
is the substraction of end_date and start_date
Returns: | the bidDays of all dependent nodes combined |
---|---|
Return type: | int |
property will return a list of connected children
connects a node to another AbstractAsset derived Node
Parameters: | asset (AbstractAsset) – Node, which should become a dependency of this Node. |
---|
method deassignes the user, who is currently assigned
will return the first item in the outputList as default output
Returns: | the first item of all outputs and None if _outputList is empty |
---|---|
Return type: | None or AbstractConnection |
method disconnects a given asset from this Node :param asset: Node, which should be disconnected :type asset: AbstractAsset
method reimoplements the end_date attribute of the assetDict
Returns: | the largest date of all dependent nodes |
---|---|
Return type: | datetime.datetime |
classmethod will return an instance the object, which is stored in the database, which matches to the given Id and will set all it’s attributes according to the given assetDict
Parameters: |
|
---|---|
Returns: | a new instance of the class, which matches the type-attribute in the assetDict |
Return type: | DataElement |
method will return the _inputDict instance variable
Returns: | _inputDict instance variable |
---|---|
Return type: | dictionary |
method will return the _outputList instance variable
Returns: | _outputList instance variable |
---|---|
Return type: | list of AbstractConnection |
returns the assetDict of this Node
Returns: | assetDict instance variable |
---|---|
Return type: | dictionary |
this method calculates the urgency of this asset by comparing the state() attribute to the start_date() and end_date() attribute and setting these attributes in relation to the current date
Returns: | state as -1=not urgent, 0=moderately urgent, 1=urgent, 2=highest priority |
---|---|
Return type: | int |
method will list all objects which are dependencies of this Node :param recursive: indicates if only teh direct dependencies(False, default) should be listed or even the indirect dependencies (dependencies of dependencies) :type recursive: bool
Returns: | a list of AbstractAsset-derivates |
---|---|
Return type: | list |
get a certain entry in the _inputDict instance variable
Parameters: | connectionName (string) – classname of the AbstractConnection-class which should be returned |
---|---|
Returns: | list of connected AbstractConnection objects |
Return type: | list of AbstractConnection |
method will search recursively for the connected project-Node
Returns: | the project-node connected to this node |
---|---|
Return type: | Project |
method will search recursively for the connected project-Node
Returns: | the project-node connected to this node |
---|---|
Return type: | Project |
returns the global state of all dependency tasks
Returns: | the state of this groupAsset |
---|---|
Return type: | int |
this method reimplements the user() attribute and will return a list of users instead,
Returns: | list of User-objects. |
---|---|
Return type: | list of User |
method will return if this asset is scheduled at the given date
Parameters: | date (datetime.datetime) – the date which is to be checked |
---|---|
Returns: | if this asset is scheduled at the given date |
Return type: | boolean |
function is a reimplementment of the postPublish function of DataElement for more information to switch back the baseId in user() to a user-object
function is a reimplementment of the prePublish function of DataElement for more information to switch the user -object to a baseId object
this method will publish the current Node with all its settings to the dataBase in a new generated version. if derived classes need to setup the attributes in any way, before and/or after publishing, the two functions prePublish and postPublish can be reimplemented!
Parameters: | recursive (bool) – indicates if the publish should go though all children of this node as well |
---|
remove a connection from the _inputDict instance variable :param connectionName: classname of the AbstractConnection-class which should be deleted :type connectionName: string
Returns: | _inputDict |
---|---|
Return type: | dictionary |
method will remove one entry from the _inputDict instance variable
Parameters: | connectionName (string) – classname of the desired connection-types |
---|---|
Returns: | the _inputDict instance variable |
Return type: | dictionary |
will remove a given connection instance from the _outputList
Parameters: | connection (AbstractConnection) – connection-object |
---|
removes a certain connectionInstance from the _outputList instance variable
Parameters: | connectionName (string) – class-name of the connection-object, which should be appended |
---|---|
Returns: | _outputList instance variable |
Return type: | list of AbstractConnection |
adds a connection-Object to the _inputDict instance variable of this Node this will in the end define if two Nodes are connected or not.
Parameters: | connection (AbstractConnection) – connection-object |
---|---|
Returns: | returns a success-boolean |
Return type: | bool |
method will update the _inputDict instance variable, which holds a key for each possible connection and assigns a list to it, which can be filled as soon as a connected asset can use a connection
Parameters: | connectionNameList (list of strings) – list of the classnames of the desired connection-types |
---|---|
Returns: | the _inputDict instance variable |
Return type: | dictionary |
similar to setInputTypes but it will add for each entry in connectionNameList a connection-object-instance which can be used for connecting later on
Parameters: | connectionNameList (list) – list of class-name sof the connection-objects, which should be appended |
---|---|
Returns: | _outputList instance variable |
Return type: | list of AbstractConnection |
method will change a property in the assetDict directly, without using the generated lambda-functions
Parameters: |
|
---|---|
Returns: | the updated assetDict |
Return type: | dictionary |
method will iter over each key of a given attribute and assign its value to the assetDict of the given instance
Parameters: |
|
---|
method reimplements certain attributes of the abstract asset which should be grouped together.
method will setup the instance-methods, which are needed to set, get or delete values in the self.assetDict instance-variable for each attribute stored in the assetDict instance-variable the will be the following functions generated: setter-> set_ATTRIBUTENAME(value) getter-> ATTRIBUTENAME() deleter-> del_ATTRIBUTENAME()
method reimoplements the start_date attribute of the assetDict
Returns: | the smalles date of all dependent nodes |
---|---|
Return type: | datetime.datetime |
method will return True in case connection is able to connect to the _inputDict of this node
Parameters: | connection (AbstractConnection) – connection-object |
---|---|
Returns: | if True node and connection can connect, if False the can’t |
Return type: | bool |