class ProjectValidator(validators.ModelValidator): anon_permissions = PgArrayField(required=False) public_permissions = PgArrayField(required=False) tags = TagsField(default=[], required=False) class Meta: model = models.Project read_only_fields = ("created_date", "modified_date", "slug", "blocked_code", "owner")
class RoleValidator(validators.ModelValidator): permissions = PgArrayField(required=False) class Meta: model = Role fields = ('id', 'name', 'permissions', 'computable', 'project', 'order') i18n_fields = ("name", )
class TaskValidator(AssignedToValidator, WatchersValidator, EditableWatchedResourceSerializer, validators.ModelValidator): tags = TagsAndTagsColorsField(default=[], required=False) external_reference = PgArrayField(required=False) class Meta: model = models.Task read_only_fields = ('id', 'ref', 'created_date', 'modified_date', 'owner')
class UserStoryValidator(AssignedToValidator, WatchersValidator, EditableWatchedResourceSerializer, validators.ModelValidator): tags = TagsAndTagsColorsField(default=[], required=False) external_reference = PgArrayField(required=False) points = RolePointsField(source="role_points", required=False) tribe_gig = PickledObjectField(required=False) class Meta: model = models.UserStory depth = 0 read_only_fields = ('id', 'ref', 'created_date', 'modified_date', 'owner')
class ProjectExportValidator(WatcheableObjectModelValidatorMixin): logo = FileField(required=False) anon_permissions = PgArrayField(required=False) public_permissions = PgArrayField(required=False) modified_date = serializers.DateTimeField(required=False) roles = RoleExportValidator(many=True, required=False) owner = UserRelatedField(required=False) memberships = MembershipExportValidator(many=True, required=False) points = PointsExportValidator(many=True, required=False) us_statuses = UserStoryStatusExportValidator(many=True, required=False) task_statuses = TaskStatusExportValidator(many=True, required=False) issue_types = IssueTypeExportValidator(many=True, required=False) issue_statuses = IssueStatusExportValidator(many=True, required=False) priorities = PriorityExportValidator(many=True, required=False) severities = SeverityExportValidator(many=True, required=False) tags_colors = JSONField(required=False) creation_template = serializers.SlugRelatedField(slug_field="slug", required=False) default_points = serializers.SlugRelatedField(slug_field="name", required=False) default_us_status = serializers.SlugRelatedField(slug_field="name", required=False) default_task_status = serializers.SlugRelatedField(slug_field="name", required=False) default_priority = serializers.SlugRelatedField(slug_field="name", required=False) default_severity = serializers.SlugRelatedField(slug_field="name", required=False) default_issue_status = serializers.SlugRelatedField(slug_field="name", required=False) default_issue_type = serializers.SlugRelatedField(slug_field="name", required=False) userstorycustomattributes = UserStoryCustomAttributeExportValidator(many=True, required=False) taskcustomattributes = TaskCustomAttributeExportValidator(many=True, required=False) issuecustomattributes = IssueCustomAttributeExportValidator(many=True, required=False) user_stories = UserStoryExportValidator(many=True, required=False) tasks = TaskExportValidator(many=True, required=False) milestones = MilestoneExportValidator(many=True, required=False) issues = IssueExportValidator(many=True, required=False) wiki_links = WikiLinkExportValidator(many=True, required=False) wiki_pages = WikiPageExportValidator(many=True, required=False) class Meta: model = projects_models.Project exclude = ('id', 'members')
class RoleExportValidator(validators.ModelValidator): permissions = PgArrayField(required=False) class Meta: model = users_models.Role exclude = ('id', 'project')