page natural key taking in account the language

This commit is contained in:
Serghei Mihai 2014-04-01 10:50:49 +02:00
parent 35cad67c87
commit 9ab73c3132
1 changed files with 6 additions and 4 deletions

View File

@ -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: