예제 #1
0
 def __init__(self, server_config=None, **kwargs):
     self._fields = {
         'ignore_me': IntegerField(),
         'many': OneToManyField(SampleEntity),
         'none': OneToOneField(SampleEntity),
         'one': OneToOneField(SampleEntity),
     }
     self._meta = {'api_path': ''}
     super(TestEntity, self).__init__(server_config, **kwargs)
예제 #2
0
class EntityWithRead(orm.Entity, orm.EntityReadMixin):
    """An entity which inherits from :class:`robottelo.orm.EntityReadMixin`."""
    one_to_one = OneToOneField(SampleEntity)
    one_to_many = OneToManyField(SampleEntity)

    class Meta(object):
        """Non-field attributes for this entity."""
        # (too-few-public-methods) pylint:disable=R0903
        api_path = ''
예제 #3
0
 def __init__(self, server_config=None, **kwargs):
     self._fields = {
         'int': IntegerField(required=True),
         'int_choices': IntegerField(choices=(1, 2), required=True),
         'int_default': IntegerField(default=5, required=True),
         'many': OneToManyField(SampleEntity, required=True),
         'one': OneToOneField(SampleEntity, required=True),
     }
     super().__init__(server_config, **kwargs)
예제 #4
0
 def __init__(self, server_config=None, **kwargs):
     self._fields = {'one_to_many': OneToManyField(SampleEntity)}
     super(SampleEntityTwo, self).__init__(server_config, **kwargs)
예제 #5
0
 def __init__(self, server_config=None, **kwargs):
     self._fields = {
         'one': OneToOneField(SampleEntity),
         'many': OneToManyField(SampleEntity),
     }
     super(EntityWithSearch2, self).__init__(server_config, **kwargs)
예제 #6
0
class ManyRelatedEntity(orm.Entity):
    """An entity with a ``OneToManyField`` pointing to ``SampleEntity``."""
    entities = OneToManyField(SampleEntity)