diff --git a/CHANGES/5033.feature b/CHANGES/5033.feature new file mode 100644 index 0000000000..4f960e320f --- /dev/null +++ b/CHANGES/5033.feature @@ -0,0 +1 @@ +Added a serializer to output `pulp_last_updated` field on pulp resources. diff --git a/pulpcore/app/serializers/base.py b/pulpcore/app/serializers/base.py index 683eb8808e..3192769812 100644 --- a/pulpcore/app/serializers/base.py +++ b/pulpcore/app/serializers/base.py @@ -418,9 +418,17 @@ class ModelSerializer( exclude_arg_name = "exclude_fields" class Meta: - fields = ("pulp_href", "pulp_created") + fields = ("pulp_href", "pulp_created", "pulp_last_updated") pulp_created = serializers.DateTimeField(help_text=_("Timestamp of creation."), read_only=True) + pulp_last_updated = serializers.DateTimeField( + help_text=_( + "Timestamp of the last time this resource was updated. Note: for immutable " + "resources - like content, repository versions, and publication - pulp_created and " + "pulp_last_updated dates will be the same." + ), + read_only=True, + ) def _validate_relative_path(self, path): """