def to_internal_value(self, data): """Resolve the version only by `id`.""" # Version queryset is unfiltered, the version is checked more # thoroughly in `RatingSerializer.validate()` method. field = PrimaryKeyRelatedField(queryset=Version.unfiltered) value = field.to_internal_value(data) return OrderedDict([('id', data), ('version', value)])
def to_internal_value(self, data): """Resolve the version only by `id`.""" # Version queryset is unfiltered, the version is checked more # thoroughly in `ReviewSerializer.validate()` method. field = PrimaryKeyRelatedField(queryset=Version.unfiltered) return field.to_internal_value(data)