Bases: sqlalchemy.ext.declarative.api.Base
The base class of all the others
The SimpleEntity is the starting point of the Stalker Object Model, it starts by adding the basic information about an entity which are name, description, the audit information like created_by, updated_by, date_created, date_updated and a couple of naming attributes like nice_name and last but not least the type attribute which is very important for entities that needs a type.
Note
For derived classes if the type needed to be specifically specified, that is it can not be None or nothing else then a Type instance, set the strictly_typed class attribute to True:
class NewClass(SimpleEntity):
__strictly_typed__ = True
This will ensure that the derived class always have a proper type attribute and can not be initialized without one.
Two SimpleEntities considered to be equal if they have the same name, the other attributes doesn’t matter.
New in version 0.2.0: Name attribute can be skipped. Starting from version 0.2.0 the name attribute can be skipped. For derived classes use the __auto_name__ class attribute to control auto naming behaviour.
Parameters: |
|
---|
Methods
__init__([name, description, type, ...]) |
Attributes
created_by | The User who has created this object. |
created_by_id | The id of the User who has created |
date_created | A datetime.datetime instance showing the creation date and time of this object. |
date_updated | A datetime.datetime instance showing the update date and time of this object. |
description | Description of this object. |
entity_type | |
generic_data | This attribute can hold any kind of data which exists in SOM. |
id | |
metadata | A collection of Table objects and their associated schema |
name | Name of this object |
nice_name | Nice name of this object. |
plural_class_name | the plural name of this class |
query | ORM-level SQL construction object. |
thumbnail | |
thumbnail_id | |
tjp_id | returns TaskJuggler compatible id |
to_tjp | renders a TaskJuggler compliant string used for TaskJuggler |
type | The type of the object. |
type_id | The id of the Type of this entity. |
updated_by | The User who has updated this object. |
updated_by_id | The id of the User who has updated |
The id of the Type of this entity. Mainly used by SQLAlchemy to create a Many-to-One relates between SimpleEntities and Types.
This attribute can hold any kind of data which exists in SOM.
Name of this object
Description of this object.
A datetime.datetime instance showing the creation date and time of this object.
A datetime.datetime instance showing the update date and time of this object.
The type of the object.
It is an instance of Type with a proper target_entity_type.
Nice name of this object.
It has the same value with the name (contextually) but with a different format like, all the white spaces replaced by underscores (“_”), all the CamelCase form will be expanded by underscore (_) characters and it is always lower case.
renders a TaskJuggler compliant string used for TaskJuggler integration. Needs to be overridden in inherited classes.
the plural name of this class