コード例 #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')
コード例 #2
0
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')
コード例 #3
0
ファイル: small_bad_related.py プロジェクト: 0u812/obj_tables
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')
コード例 #4
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
コード例 #5
0
ファイル: small_bad_related.py プロジェクト: 0u812/obj_tables
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