Ejemplo n.º 1
0
class Reaction(core.Model):
    model = core.ManyToOneAttribute(Model, related_name='reactions')
    id = core.SlugAttribute()
    metabolites = core.ManyToManyAttribute(Metabolite,
                                           related_name='reactions')
    enzyme = core.ManyToOneAttribute(Protein, related_name='reactions')

    class Meta(core.Model.Meta):
        attribute_order = ('model', 'id', 'metabolites', 'enzyme')
Ejemplo n.º 2
0
class Protein(core.Model):
    model = core.ManyToOneAttribute(Model, related_name='proteins')
    rna = core.ManyToOneAttribute(Rna, related_name='proteins')
    id = core.SlugAttribute()

    class Meta(core.Model.Meta):
        attribute_order = (
            'model',
            'rna',
            'id',
        )
Ejemplo n.º 3
0
class Rna(core.Model):
    model = core.ManyToOneAttribute(Model, related_name='rna')
    gene = core.ManyToOneAttribute(Gene, related_name='rna')
    id = core.SlugAttribute()

    class Meta(core.Model.Meta):
        attribute_order = (
            'model',
            'gene',
            'id',
        )
Ejemplo n.º 4
0
class Metabolite(core.Model):
    model = core.ManyToOneAttribute(Model, related_name='metabolites')
    id = core.SlugAttribute()

    class Meta(core.Model.Meta):
        attribute_order = (
            'model',
            'id',
        )
Ejemplo n.º 5
0
class Level00(core.Model):
    id = core.SlugAttribute()
    parent = core.ManyToOneAttribute('Level0', related_name='children_00')

    class Meta(core.Model.Meta):
        children = {
            'left': ['child_000', 'children_001'],
            'all': ['child_000', 'children_001'],
        }
Ejemplo n.º 6
0
class Level01(core.Model):
    id = core.SlugAttribute()
    child_010 = core.OneToOneAttribute('Level010', related_name='parent')
    child_011 = core.ManyToOneAttribute('Level011', related_name='parents')

    class Meta(core.Model.Meta):
        children = {
            'right': ['child_010', 'child_011'],
            'all': ['child_010', 'child_011'],
        }
Ejemplo n.º 7
0
        class Parent(core.Model):
            id = core.SlugAttribute(verbose_name='Id')
            name = core.StringAttribute(verbose_name='Name')
            child = core.ManyToOneAttribute(Child,
                                            related_name='parents',
                                            verbose_name='Child')

            class Meta(core.Model.Meta):
                attribute_order = ('id', 'name', 'child')
                verbose_name = 'Parent'
                verbose_name_plural = 'Parent'
Ejemplo n.º 8
0
 class Child(core.Model):
     id = core.SlugAttribute()
     parent = core.ManyToOneAttribute(Parent, related_name='children')
Ejemplo n.º 9
0
 class Gen3(core.Model):
     id = core.SlugAttribute()
     parent = core.ManyToOneAttribute(Gen2, related_name='children')
Ejemplo n.º 10
0
 class DisjointChild(core.Model):
     parent = core.ManyToOneAttribute(DisjointParent,
                                      related_name='children')
Ejemplo n.º 11
0
class Leaf(core.Model):
    id = core.StringAttribute(primary=True)
    node = core.ManyToOneAttribute(Node, related_name='leaves')
Ejemplo n.º 12
0
class Node(core.Model):
    id = core.StringAttribute(max_length=2, primary=True, unique=True)
    root = core.ManyToOneAttribute(Root, related_name='nodes')