示例#1
0
class Author(BaseResource):
    id: str = resource_id()
    name: str = attribute()
    birthplace: str = attribute()
    date_of_birth: date = attribute(decoder=date.fromisoformat)
    date_of_death: date = attribute(decoder=date.fromisoformat)
    books: List['Book'] = relationship()
    photos: List['Photo'] = relationship()
class Article(BaseResource):
    id: str = resource_id()
    title: str = attribute()
    number: int = attribute()
    some_date: date = attribute(decoder=date.fromisoformat)
    comments: List[Comment] = relationship()
    some_optional: Optional[int] = attribute()
    author: People = relationship()
示例#3
0
 class Resource(BaseResource):
     id: str = resource_id()
     relationship1: Relationship = relationship()
示例#4
0
 class Relationship(BaseResource):
     id: str = resource_id()
     attribute1: str = attribute()
示例#5
0
 class Resource(BaseResource):
     id: str = resource_id()
     attribute1: str = attribute()
示例#6
0
 class Resource(BaseResource):
     id: str = resource_id()
     attribute1: date = attribute(decoder=date.fromisoformat)
示例#7
0
 class Relationshup(BaseResource):
     id: str = resource_id()
示例#8
0
 class Resource(BaseResource):
     id: str = resource_id()
     relationship1: ForwardRef("Relationship") = relationship()
示例#9
0
 class Resource(BaseResource):
     id: str = resource_id()
示例#10
0
 class Resource(BaseResource):
     id: str = resource_id()
     relationship1: Optional[Relationship] = relationship()
示例#11
0
class Book(BaseResource):
    id: str = resource_id()
示例#12
0
class Photo(BaseResource):
    id: str = resource_id()
示例#13
0
 class Resource(BaseResource):
     id1: str = resource_id()
     id2: str = resource_id()
示例#14
0
class Comment(BaseResource):
    id: str = resource_id()
    body: str = attribute()
示例#15
0
class People(BaseResource):
    id: str = resource_id()
    first_name: str = attribute()
    last_name: str = attribute()
    twitter: str = attribute()