page natural key taking in account the language
This commit is contained in:
parent
35cad67c87
commit
9ab73c3132
|
@ -14,9 +14,6 @@ exclude_attrs = {'Page': ('site',),
|
|||
'Title': ()
|
||||
}
|
||||
|
||||
def page_natural_key(self):
|
||||
return (self.get_path('fr'), )
|
||||
|
||||
def title_natural_key(self):
|
||||
return (self.path, )
|
||||
|
||||
|
@ -26,7 +23,6 @@ def placeholder_natural_key(self):
|
|||
def plugin_natural_key(self):
|
||||
return self.placeholder.natural_key() + (self.plugin_type, self.position)
|
||||
|
||||
Page.natural_key = page_natural_key
|
||||
Title.natural_key = title_natural_key
|
||||
Placeholder.natural_key = placeholder_natural_key
|
||||
CMSPlugin.natural_key = plugin_natural_key
|
||||
|
@ -75,6 +71,12 @@ class Command(BaseCommand):
|
|||
return data
|
||||
|
||||
def handle(self, *args, **options):
|
||||
|
||||
def page_natural_key(self):
|
||||
return (self.get_path(options['lang']), )
|
||||
|
||||
Page.natural_key = page_natural_key
|
||||
|
||||
self.options = options
|
||||
page = Page.objects.get(pk=options['page'])
|
||||
with open(options.get('output'), 'w') as output:
|
||||
|
|
Reference in New Issue