class Execution(Model): ''' keeps track of the pointers and related data during a process'sss execution ''' process_name = fields.Text() name = fields.Text() description = fields.Text() pointers = fields.SetRelation('cacahuate.models.Pointer', inverse='execution') actors = fields.SetRelation('cacahuate.models.User', inverse='activities')
class Execution(Model): ''' keeps track of the pointers and related data during a process'sss execution ''' process_name = fields.Text() name = fields.Text() name_template = fields.Text(default='') description = fields.Text() description_template = fields.Text(default='') pointers = fields.SetRelation('cacahuate.models.Pointer', inverse='execution') actors = fields.SetRelation('cacahuate.models.User', inverse='activities') started_at = fields.Datetime() finished_at = fields.Datetime(required=False) status = fields.Text()
class User(Model): ''' those humans who can execute actions ''' identifier = fields.Text(index=True) fullname = fields.Text() email = fields.Text() tokens = fields.SetRelation('cacahuate.models.Token', inverse='user') # processes I'm participating in activities = fields.SetRelation('cacahuate.models.Execution', inverse='actors') # pending tasks to solve tasks = fields.SetRelation('cacahuate.models.Pointer', inverse='candidates') def get_contact_info(self, attr): return getattr(self, attr)
class Pointer(Model): ''' marks a node and a execution so it can continue from there ''' node_id = fields.Text() name = fields.Text() description = fields.Text() execution = fields.ForeignIdRelation(Execution, inverse='pointers') candidates = fields.SetRelation('cacahuate.models.User', inverse='tasks')
class UnattachedPerson(Model): name = fields.Text() pets = fields.SetRelation(Pet, on_delete='set_null', inverse='owner')
class Person(Model): name = fields.Text() pets = fields.SetRelation(Pet, on_delete='cascade', inverse='owner')
class B(Model): attr = fields.Text() a = fields.ForeignIdRelation(A, inverse='bs') cs = fields.SetRelation('coralillo.tests.models.C', inverse='b')
class A(Model): attr = fields.Text() bs = fields.SetRelation('coralillo.tests.models.B', inverse='a')
class Office(Model): name = fields.Text() address = fields.Text() employees = fields.SetRelation(Employee, inverse='office')
class Car(Model): name = fields.Text() drivers = fields.SetRelation(Driver, inverse='cars')
class Driver(Model): name = fields.Text() cars = fields.SetRelation('coralillo.tests.models.Car', inverse='drivers')