Changeset View
Changeset View
Standalone View
Standalone View
swh/model/model.py
Show First 20 Lines • Show All 193 Lines • ▼ Show 20 Lines | def from_dict(cls, d): | ||||
for (name, branch) in d['branches'].items() | for (name, branch) in d['branches'].items() | ||||
}) | }) | ||||
@attr.s | @attr.s | ||||
class Release(BaseModel): | class Release(BaseModel): | ||||
id = attr.ib(type=Sha1Git) | id = attr.ib(type=Sha1Git) | ||||
name = attr.ib(type=bytes) | name = attr.ib(type=bytes) | ||||
message = attr.ib(type=bytes) | comment = attr.ib(type=bytes) | ||||
target = attr.ib(type=Optional[Sha1Git], | target = attr.ib(type=Optional[Sha1Git], | ||||
validator=attr.validators.optional([])) | validator=attr.validators.optional([])) | ||||
target_type = attr.ib(type=ObjectType) | target_type = attr.ib(type=ObjectType) | ||||
synthetic = attr.ib(type=bool) | synthetic = attr.ib(type=bool) | ||||
author = attr.ib(type=Optional[Person], | author = attr.ib(type=Optional[Person], | ||||
default=None, | default=None, | ||||
validator=attr.validators.optional([])) | validator=attr.validators.optional([])) | ||||
date = attr.ib(type=Optional[TimestampWithTimezone], | date = attr.ib(type=Optional[TimestampWithTimezone], | ||||
▲ Show 20 Lines • Show All 145 Lines • Show Last 20 Lines |