Beispiel #1
0
 class AVO(ValueObject):
     a = Attr()
     b = Attr()
     c = Attr()
     d = Attr()
     e = Attr()
     f = Attr()
     g = Attr()
     h = Attr()
Beispiel #2
0
class Article(Entity):
    id: ArticleId = Attr()
    title: str = Attr()
    content: str = Attr()
    author: Author = Attr()
    created_at: datetime = Attr()
    updated_at: datetime = Attr(allow_none=True)
    deleted_at: datetime = Attr(allow_none=True)
    tags: List = Attr(default=list)
Beispiel #3
0
        class AVO(ValueObject):
            a = Attr()

            @a.validator
            def is_integer(self, value):
                if isinstance(value, numbers.Integral):
                    return True
                raise TypeError()

            @a.validator
            def between(self, value):
                return 0 < value < 100
Beispiel #4
0
 class MotherVO(GrandmaVO):
     e = Attr()
     f = Attr()
Beispiel #5
0
 class AnotherE(Entity):
     id = Attr()
     a = Attr()
     b = Attr()
Beispiel #6
0
 class AE(Entity):
     id = Attr()
     a = Attr()
     b = Attr()
Beispiel #7
0
 class AVO(ValueObject):
     a = Attr(type=int)
     b = Attr(type=str)
Beispiel #8
0
 class AnotherVO(ValueObject):
     a = Attr()
     b = Attr(default=None)
     c = Attr()
Beispiel #9
0
 class AnotherVO(ValueObject):
     a = Attr()
     b = Attr()
Beispiel #10
0
 class AVO(ValueObject):
     a = Attr(type=numbers.Real,
              validator=lambda instance, value: 0 < value < 100)
Beispiel #11
0
 class AnotherVO(ValueObject):
     a = Attr()
     b = Attr(hash=False)
Beispiel #12
0
 class AVO(ValueObject):
     a = Attr()
     b = Attr(allow_none=True)
     c: int = Attr(allow_none=True)
     d: tuple = Attr(allow_none=True, default=tuple)
Beispiel #13
0
 class AVO(ValueObject):
     a = Attr(type=int, default='s')
Beispiel #14
0
 class ChildVO(MotherVO, FatherVO):
     g = Attr()
     h = Attr()
Beispiel #15
0
 class AnotherVO(ValueObject):
     x = Attr()
Beispiel #16
0
 class AVO(ValueObject):
     a = Attr()
     b: str = Attr()
     c: int = 1
Beispiel #17
0
 class AVO(ValueObject):
     a = Attr()
     b = Attr()
Beispiel #18
0
 class AVO(ValueObject):
     a = Attr(default=5)
     b = Attr()
Beispiel #19
0
 class GrandmaVO(ValueObject):
     a = Attr()
     b = Attr()
Beispiel #20
0
class Tag(Entity):
    id: TagId = Attr()
    name: str = Attr()
Beispiel #21
0
 class FatherVO(GrandmaVO):
     c = Attr()
     d = Attr()
Beispiel #22
0
class Author(ValueObject):
    id: int = Attr()
    name: str = Attr()
Beispiel #23
0
class Id(ValueObject):
    value: int = Attr()

    @classmethod
    def next(cls):
        return cls(services.generate_unique_id())