class Parent(core.Model): id = core.SlugAttribute() name = core.StringAttribute() class Meta(core.Model.Meta): attribute_order = ('id', 'name') table_format = core.TableFormat.column
class Parent(core.Model): id = core.SlugAttribute() name = core.StringAttribute() age = core.IntegerAttribute() class Meta(core.Model.Meta): table_format = core.TableFormat.cell
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')
class Child(core.Model): id = core.SlugAttribute(verbose_name='Id') name = core.StringAttribute(verbose_name='Name') class Meta(core.Model.Meta): attribute_order = ('id', 'name') verbose_name = 'Child' verbose_name_plural = 'Child'
class Child(core.Model): id = core.SlugAttribute(verbose_name='Id') name = core.StringAttribute(verbose_name='Name') class Meta(core.Model.Meta): attribute_order = ('id', 'name') table_format = core.TableFormat.multiple_cells verbose_name = 'Child' verbose_name_plural = 'Child'
class Quantity(core.Model): value = core.FloatAttribute() units = core.StringAttribute() class Meta(core.Model.Meta): attribute_order = ('value', 'units') table_format = core.TableFormat.multiple_cells def serialize(self): return '{} {}'.format(value, units)
class Parent(core.Model): quantity_1 = core.OneToOneAttribute('Quantity', related_name='parent_q_1') quantity_2 = core.OneToOneAttribute('Quantity', related_name='parent_q_2') value = core.FloatAttribute() units = core.StringAttribute() class Meta(core.Model.Meta): attribute_order = ('quantity_1', 'quantity_2', 'value', 'units')
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'
class DisjointParent(core.Model): id = core.StringAttribute(primary=True, unique=True)
class Leaf(core.Model): id = core.StringAttribute(primary=True) node = core.ManyToOneAttribute(Node, related_name='leaves')
class Node(core.Model): id = core.StringAttribute(max_length=2, primary=True, unique=True) root = core.ManyToOneAttribute(Root, related_name='nodes')
class NormNodeLevel2(core.Model): label = core.StringAttribute(primary=True, unique=True) parents = core.ManyToManyAttribute(NormNodeLevel1, related_name='children')
class Model(core.Model): id = core.StringAttribute()
class Parent(core.Model): id = core.SlugAttribute() name = core.StringAttribute()
class TestModel(core.Model): registry = pint.UnitRegistry() str_attr = core.StringAttribute() unit_attr_1 = units.UnitAttribute(registry) unit_attr_2 = units.UnitAttribute(registry)
class Root(core.Model): id = core.StringAttribute(max_length=1, primary=True, unique=True, verbose_name='Identifier')
class Test(core.Model): val = core.StringAttribute()
class Child(core.Model): id = core.SlugAttribute() name = core.StringAttribute() parents = core.ManyToManyAttribute(Parent, related_name='children')
class NormNodeLevel0(core.Model): label = core.StringAttribute(primary=True, unique=True)
class Model(core.Model): attr_1 = core.StringAttribute() attr_2 = core.StringAttribute() class Meta(core.Model.Meta): merge = core.ModelMerge.join
class NoPrimary(core.Model): name = core.StringAttribute() def serialize(self): return self.name