class ChangedTest(Model): # Model Test renamed to ChangedTest id = SlugAttribute() name = StringAttribute(default='test') # Attribute Test.existing_attr renamed to ChangedTest.migrated_attr migrated_attr = StringAttribute() # Attribute ChangedTest.revision added revision = StringAttribute(default='0.0') # Type of attribute Test.size changed to an integer size = IntegerAttribute()
class Test(obj_tables.Model): id = SlugAttribute() name = StringAttribute(default='test') revision = StringAttribute(default='0.0') existing_attr = StringAttribute(default='existing_attr_val') references = ManyToManyAttribute('Reference', related_name='tests') class Meta(obj_tables.Model.Meta): attribute_order = ('id', 'name', 'revision', 'existing_attr') table_format = TableFormat.column
class Test(obj_tables.Model): """ Test Related attributes: property (:obj:`Property`): property subtests (:obj:`list` of `Subtest`): subtests """ id = SlugAttribute() name = StringAttribute(default='test') version = RegexAttribute(min_length=1, pattern=r'^[0-9]+\.[0-9+]\.[0-9]+', flags=re.I) revision = StringAttribute(default='0.0') existing_attr = StringAttribute(default='existing_attr_val') class Meta(obj_tables.Model.Meta): attribute_order = ('id', 'name', 'version', 'revision', 'existing_attr') table_format = TableFormat.column
class Test(obj_tables.Model): id = SlugAttribute() name = StringAttribute(default='test') existing_attr = IntegerAttribute(default=3) references = ManyToManyAttribute('Reference', related_name='tests') class Meta(obj_tables.Model.Meta): attribute_order = ('id', 'name', 'existing_attr')
class Reference(obj_tables.Model): """ Reference Related attributes: subtests (:obj:`list` of `Subtest`): subtests """ id = SlugAttribute() value = StringAttribute() class Meta(obj_tables.Model.Meta): attribute_order = ('id', 'value')
class Reference(Model): """ Another definition of Reference, which causes a _check_imported_models error Related attributes: subtests (:obj:`list` of `Subtest`): subtests """ id = SlugAttribute() value = StringAttribute() class Meta(Model.Meta): attribute_order = ('id', 'value')
class Test(Model): """ Test Related attributes: subtests (:obj:`list` of `Subtest`): subtests """ id = SlugAttribute() name = StringAttribute(default='my name') references = ManyToManyAttribute(Reference, related_name='tests') class Meta(Model.Meta): attribute_order = ('id', 'name', 'references') table_format = TableFormat.column
class Reference(Model): id = SlugAttribute() value = StringAttribute()
class Reference(obj_tables.Model): id = SlugAttribute() value = StringAttribute() class Meta(obj_tables.Model.Meta): attribute_order = ('id', 'value')
class Test(Model): id = SlugAttribute() name = StringAttribute(default='test') existing_attr = StringAttribute() size = FloatAttribute() color = StringAttribute()