kopia lustrzana https://github.com/wagtail/wagtail
Don't fetch all related instances when creating revision object
rodzic
aa1a848bf2
commit
f68dd505d0
|
@ -2788,7 +2788,7 @@ class Page(AbstractPage, index.Indexed, ClusterableModel, metaclass=PageBase):
|
||||||
# These should definitely never change between revisions
|
# These should definitely never change between revisions
|
||||||
obj.id = self.id
|
obj.id = self.id
|
||||||
obj.pk = self.pk
|
obj.pk = self.pk
|
||||||
obj.content_type = self.content_type
|
obj.content_type_id = self.content_type_id
|
||||||
|
|
||||||
# Override possibly-outdated tree parameter fields
|
# Override possibly-outdated tree parameter fields
|
||||||
obj.path = self.path
|
obj.path = self.path
|
||||||
|
@ -2804,15 +2804,15 @@ class Page(AbstractPage, index.Indexed, ClusterableModel, metaclass=PageBase):
|
||||||
obj.draft_title = self.draft_title
|
obj.draft_title = self.draft_title
|
||||||
obj.live = self.live
|
obj.live = self.live
|
||||||
obj.has_unpublished_changes = self.has_unpublished_changes
|
obj.has_unpublished_changes = self.has_unpublished_changes
|
||||||
obj.owner = self.owner
|
obj.owner_id = self.owner_id
|
||||||
obj.locked = self.locked
|
obj.locked = self.locked
|
||||||
obj.locked_by = self.locked_by
|
obj.locked_by_id = self.locked_by_id
|
||||||
obj.locked_at = self.locked_at
|
obj.locked_at = self.locked_at
|
||||||
obj.latest_revision = self.latest_revision
|
obj.latest_revision_id = self.latest_revision_id
|
||||||
obj.latest_revision_created_at = self.latest_revision_created_at
|
obj.latest_revision_created_at = self.latest_revision_created_at
|
||||||
obj.first_published_at = self.first_published_at
|
obj.first_published_at = self.first_published_at
|
||||||
obj.translation_key = self.translation_key
|
obj.translation_key = self.translation_key
|
||||||
obj.locale = self.locale
|
obj.locale_id = self.locale_id
|
||||||
obj.alias_of_id = self.alias_of_id
|
obj.alias_of_id = self.alias_of_id
|
||||||
revision_comment_positions = dict(
|
revision_comment_positions = dict(
|
||||||
getattr(obj, COMMENTS_RELATION_NAME).values_list("id", "position")
|
getattr(obj, COMMENTS_RELATION_NAME).values_list("id", "position")
|
||||||
|
|
Ładowanie…
Reference in New Issue