Пример #1
0
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')
Пример #2
0
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()
Пример #3
0
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)
Пример #4
0
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')
Пример #5
0
class UnattachedPerson(Model):
    name = fields.Text()
    pets = fields.SetRelation(Pet, on_delete='set_null', inverse='owner')
Пример #6
0
class Person(Model):
    name = fields.Text()
    pets = fields.SetRelation(Pet, on_delete='cascade', inverse='owner')
Пример #7
0
class B(Model):
    attr = fields.Text()
    a = fields.ForeignIdRelation(A, inverse='bs')
    cs = fields.SetRelation('coralillo.tests.models.C', inverse='b')
Пример #8
0
class A(Model):
    attr = fields.Text()
    bs = fields.SetRelation('coralillo.tests.models.B', inverse='a')
Пример #9
0
class Office(Model):
    name = fields.Text()
    address = fields.Text()
    employees = fields.SetRelation(Employee, inverse='office')
Пример #10
0
class Car(Model):
    name = fields.Text()
    drivers = fields.SetRelation(Driver, inverse='cars')
Пример #11
0
class Driver(Model):
    name = fields.Text()
    cars = fields.SetRelation('coralillo.tests.models.Car', inverse='drivers')