stalker.core.models.entity.SimpleEntity

Inheritance diagram of stalker.core.models.entity.SimpleEntity

class stalker.core.models.entity.SimpleEntity(name=None, description='', created_by=None, updated_by=None, date_created=datetime.datetime(2011, 1, 13, 18, 37, 26, 361690), date_updated=datetime.datetime(2011, 1, 13, 18, 37, 26, 361702), code=None)[source]

Bases: object

The base class of all the others

This class has the basic information about an entity which are the name, the description, tags and the audit information like created_by, updated_by, date_created and date_updated about this entity.

Parameters:
  • name – a string or unicode attribute that holds the name of this entity. it could not be empty, the first letter should be an alphabetic (not alphanumeric) letter and it should not contain any white space at the beggining and at the end of the string
  • description – a string or unicode attribute that holds the description of this entity object, it could be an empty string, and it could not again have white spaces at the beggining and at the end of the string
  • created_by – the created_by attribute should contain a User object who is created this object
  • updated_by – the updated_by attribute should contain a User object who is updated the user lastly. the created_by and updated_by attributes should point the same object if this entity is just created
  • date_created – the date that this object is created. it should be a time before now
  • date_updated – this is the date that this object is updated lastly. for newly created entities this is equal to date_created and the date_updated cannot be before date_created
  • code – this is the code name of this simple entity, can be omitted and it will be set to the uppercase version of the nice_name attribute. it accepts string or unicode values. If both the name and code arguments are given the the code property will be set to code, but in any update to name attribute the code also will be updated to the uppercase form of the nice_name attribute
__init__(name=None, description='', created_by=None, updated_by=None, date_created=datetime.datetime(2011, 1, 13, 18, 37, 26, 361690), date_updated=datetime.datetime(2011, 1, 13, 18, 37, 26, 361702), code=None)[source]

Methods

__init__(1, 13, 18, 37, 26, 1, 13, 18, 37, 26)

Attributes

code
created_by gets and sets the User object who has created this
date_created gets and sets the datetime.datetime object which shows when
date_updated gets and sets the datetime.datetime object which shows when
description the description of the entity
name the name of the entity
nice_name this is the nice name of the SimpleEntity. It has the same
updated_by gets and sets the User object who has updated this
created_by[source]

gets and sets the User object who has created this AuditEntity

date_created[source]

gets and sets the datetime.datetime object which shows when this object has been created

date_updated[source]

gets and sets the datetime.datetime object which shows when this object has been updated

description[source]

the description of the entity

name[source]

the name of the entity

nice_name

this is the nice name of the SimpleEntity. It has the same value with the name (contextually) but with a different format like, all the whitespaces replaced by underscores (“_”), all the CamelCase form will be expanded by underscore (_) characters and it is always lowercase.

There is also the code attribute which is simple the uppercase form of nice_name if it is not defined differently (i.e set to another value).

updated_by[source]

gets and sets the User object who has updated this AuditEntity

Previous topic

stalker.core.models.entity

Next topic

stalker.core.models.entity.Entity

This Page