@@ -40,9 +40,7 @@ def _get_related_objects(cls):
40
40
41
41
def copy (self , target , language ):
42
42
"""
43
- This method copies this extension to an unrelated-target. If you intend
44
- to "publish" this extension to the publisher counterpart of target, then
45
- use copy_to_publish() instead.
43
+ This method copies this extension to an unrelated-target.
46
44
"""
47
45
clone = self .__class__ .objects .get (pk = self .pk ) # get a copy of this instance
48
46
clone .pk = None
@@ -60,40 +58,17 @@ def copy(self, target, language):
60
58
61
59
def copy_to_public (self , public_object , language ):
62
60
"""
63
- This method is used to "publish" this extension as part of the a larger
64
- operation on the target. If you intend to copy this extension to an
65
- unrelated object, use copy() instead.
61
+ .. warning::
62
+
63
+ This method used to "publish" this extension as part of the a larger operation on the target.
64
+ Publishing pages has been removed from django CMS core in version 4 onward.
65
+
66
+ For publishing functionality see `djangocms-versioning: <https://github.com/django-cms/djangocms-verisoning>`_
66
67
"""
67
- this = self .__class__ .objects .get (pk = self .pk ) # get a copy of this instance
68
- public_extension = self .public_extension # get the public version of this instance if any
69
-
70
- this .extended_object = public_object # set the new public object
71
-
72
- if public_extension :
73
- # overwrite current public extension
74
- this .pk = public_extension .pk
75
- # remove public extension, or it will point to itself and raise duplicate entry
76
- this .public_extension = None
77
-
78
- # Set public_extension concrete parents PKs. See issue #5494
79
- for parent , field in this ._meta .parents .items ():
80
- if field :
81
- setattr (this , parent ._meta .pk .attname , getattr (public_extension , parent ._meta .pk .attname ))
82
- else :
83
- this .pk = None # create new public extension
84
-
85
- # Nullify all concrete parent primary keys. See issue #5494
86
- for parent , field in this ._meta .parents .items ():
87
- if field :
88
- setattr (this , parent ._meta .pk .attname , None )
89
-
90
- this .save ()
91
- self .public_extension = this
92
- self .save ()
93
-
94
- this .copy_relations (self , language )
95
- this .save (force_update = True )
96
- return this
68
+ import warnings
69
+ warnings .warn ('This API function has been removed. For publishing functionality use a package that adds '
70
+ 'publishing, such as: djangocms-versioning.' ,
71
+ UserWarning , stacklevel = 2 )
97
72
98
73
99
74
class PageExtension (BaseExtension ):
0 commit comments