Beispiel #1
0
class Subtest(obj_tables.Model):
    id = SlugAttribute()
    test = ManyToOneAttribute(Test, related_name='subtests')
    references = ManyToManyAttribute('Reference', related_name='subtests')

    class Meta(obj_tables.Model.Meta):
        attribute_order = ('id', 'test', 'references')
Beispiel #2
0
class Property(obj_tables.Model):
    id = SlugAttribute()
    test = OneToOneAttribute(Test, related_name='property')
    value = PositiveIntegerAttribute()

    class Meta(obj_tables.Model.Meta):
        attribute_order = ('id', 'test', 'value')
        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')
Beispiel #4
0
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()
Beispiel #5
0
class Subtest(Model):
    """ Subtest
    """
    id = SlugAttribute()
    test = ManyToOneAttribute(Test, related_name='subtests')
    references = ManyToManyAttribute(Reference, related_name='subtests')

    class Meta(Model.Meta):
        attribute_order = ('id', 'test', 'references')
Beispiel #6
0
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
Beispiel #7
0
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(obj_tables.Model):
    """ Test

    Related attributes:
        property (:obj:`Property`): property
        subtests (:obj:`list` of `Subtest`): subtests
    """
    id = SlugAttribute()

    class Meta(obj_tables.Model.Meta):
        attribute_order = ('id', )
Beispiel #9
0
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')
Beispiel #10
0
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
Beispiel #11
0
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
Beispiel #12
0
class Reference(Model):
    id = SlugAttribute()
    value = StringAttribute()
class Reference(obj_tables.Model):
    id = SlugAttribute()
    published = BooleanAttribute()

    class Meta(obj_tables.Model.Meta):
        attribute_order = ('id', 'published')
Beispiel #14
0
class Test(Model):
    id = SlugAttribute()
    name = StringAttribute(default='test')
    existing_attr = StringAttribute()
    size = FloatAttribute()
    color = StringAttribute()
Beispiel #15
0
class DeletedModel(obj_tables.Model):
    id = SlugAttribute()

    class Meta(obj_tables.Model.Meta):
        attribute_order = ('id', )
Beispiel #16
0
class Reference(obj_tables.Model):
    id = SlugAttribute()
    value = StringAttribute()

    class Meta(obj_tables.Model.Meta):
        attribute_order = ('id', 'value')
Beispiel #17
0
class Property(Model):
    id = SlugAttribute()
    value = PositiveIntegerAttribute()