kopia lustrzana https://github.com/wagtail/wagtail
Page copy method to use exclude_fields_in_copy
rodzic
cd924d0948
commit
d31f600714
|
@ -1031,8 +1031,9 @@ class Page(six.with_metaclass(PageBase, AbstractPage, index.Indexed, Clusterable
|
|||
|
||||
def copy(self, recursive=False, to=None, update_attrs=None, copy_revisions=True, keep_live=True, user=None):
|
||||
# Fill dict with self.specific values
|
||||
exclude_fields = ['id', 'path', 'depth', 'numchild', 'url_path', 'path']
|
||||
specific_self = self.specific
|
||||
default_exclude_fields = ['id', 'path', 'depth', 'numchild', 'url_path', 'path']
|
||||
exclude_fields = default_exclude_fields + specific_self.exclude_fields_in_copy
|
||||
specific_dict = {}
|
||||
|
||||
for field in specific_self._meta.get_fields():
|
||||
|
|
Ładowanie…
Reference in New Issue