예제 #1
0
        class Child(core.Model):
            id = core.SlugAttribute()
            name = core.StringAttribute()
            parents = core.ManyToManyAttribute(Parent, related_name='children')

            class Meta(core.Model.Meta):
                attribute_order = ('id', 'name', 'parents')
예제 #2
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')
예제 #3
0
        class Parent(core.Model):
            id = core.SlugAttribute(verbose_name='Id')
            name = core.StringAttribute(verbose_name='Name')
            children = core.ManyToManyAttribute(Child,
                                                related_name='parents',
                                                verbose_name='Children')

            class Meta(core.Model.Meta):
                attribute_order = ('id', 'name', 'children')
                verbose_name = 'Parent'
                verbose_name_plural = 'Parent'
예제 #4
0
 class Gen3(core.Model):
     id = core.SlugAttribute()
     parents = core.ManyToManyAttribute(Gen2, related_name='children')
예제 #5
0
 class Child(core.Model):
     id = core.SlugAttribute()
     parents = core.ManyToManyAttribute(Parent, related_name='children')
예제 #6
0
 class NormNodeLevel2(core.Model):
     label = core.StringAttribute(primary=True, unique=True)
     parents = core.ManyToManyAttribute(NormNodeLevel1,
                                        related_name='children')
예제 #7
0
class Level001(core.Model):
    id = core.SlugAttribute()
    parents = core.ManyToManyAttribute('Level00', related_name='children_001')