class GroupValidator(serializers.Serializer): status = serializers.ChoiceField(choices=zip( STATUS_CHOICES.keys(), STATUS_CHOICES.keys() )) statusDetails = StatusDetailsValidator() hasSeen = serializers.BooleanField() isBookmarked = serializers.BooleanField() isPublic = serializers.BooleanField() isSubscribed = serializers.BooleanField() merge = serializers.BooleanField() ignoreDuration = serializers.IntegerField() ignoreCount = serializers.IntegerField() # in hours, max of one week ignoreWindow = serializers.IntegerField(max_value=7 * 24) ignoreUserCount = serializers.IntegerField() # in hours, max of one week ignoreUserWindow = serializers.IntegerField(max_value=7 * 24) assignedTo = UserField() # TODO(dcramer): remove in 9.0 snoozeDuration = serializers.IntegerField() def validate_assignedTo(self, attrs, source): value = attrs[source] if value and not self.context['project'].member_set.filter(user=value).exists(): raise serializers.ValidationError('Cannot assign to non-team member') return attrs
class GroupSerializer(serializers.Serializer): status = serializers.ChoiceField( choices=zip(STATUS_CHOICES.keys(), STATUS_CHOICES.keys())) isBookmarked = serializers.BooleanField() hasSeen = serializers.BooleanField() assignedTo = UserField() snoozeDuration = serializers.IntegerField()
class GroupSerializer(serializers.Serializer): status = serializers.ChoiceField( choices=zip(STATUS_CHOICES.keys(), STATUS_CHOICES.keys())) isBookmarked = serializers.BooleanField() hasSeen = serializers.BooleanField() assignedTo = UserField() snoozeDuration = serializers.IntegerField() redmineId = serializers.CharField() # add by hzwangzhiwei @20160411 blameInfo = serializers.CharField() # add by hzwangzhiwei @20160612 followerId = serializers.IntegerField() # add by hzwangzhiwei @20160824
class GroupSerializer(serializers.Serializer): status = serializers.ChoiceField( choices=zip(STATUS_CHOICES.keys(), STATUS_CHOICES.keys())) isBookmarked = serializers.BooleanField() isSubscribed = serializers.BooleanField() hasSeen = serializers.BooleanField() assignedTo = UserField() ignoreDuration = serializers.IntegerField() # TODO(dcramer): remove in 9.0 snoozeDuration = serializers.IntegerField()
class GroupSerializer(serializers.Serializer): status = serializers.ChoiceField( choices=zip(STATUS_CHOICES.keys(), STATUS_CHOICES.keys())) isBookmarked = serializers.BooleanField() assignedTo = UserField()