def last_migrate_layout(self): """Migrate the layout (view method). This needs to be done last, as otherwise our changes may get overriden by a later call to migrate_properties. """ old_layout = self.old.getLayout() or getattr(self.old, 'layout', None) if old_layout: try: # Delete old-style layout attribute. del self.new.layout except AttributeError: pass self.new.setLayout(LISTING_VIEW_MAPPING.get(old_layout, old_layout)) # noqa
def last_migrate_layout(self): """Migrate the layout (view method). This needs to be done last, as otherwise our changes in migrate_criteria may get overriden by a later call to migrate_properties. """ old_layout = getattr(aq_base(self.old), 'layout', None) if old_layout: default_page = getattr(aq_base(self.old), 'default_page', None) try: # Delete old-style layout attribute. del self.new.layout except AttributeError: pass # always copy over the layout, transform if necessary self.new.setLayout(LISTING_VIEW_MAPPING.get(old_layout, old_layout)) # noqa if default_page: # any defaultPage is switched of by setLayout # and needs to set again if it was directly on the object self.new.setDefaultPage(default_page)
def last_migrate_layout(self): """Migrate the layout (view method). This needs to be done last, as otherwise our changes in migrate_criteria may get overriden by a later call to migrate_properties. """ old_layout = self.old.getLayout() or getattr(self.old, 'layout', None) if old_layout: default_page = self.old.getDefaultPage() or \ getattr(self.old, 'default_page', None) try: # Delete old-style layout attribute. del self.new.layout except AttributeError: pass self.new.setLayout(LISTING_VIEW_MAPPING.get(old_layout, old_layout)) # noqa if default_page: # any defaultPage is switched of by setLayout # and needs to set again self.new.setDefaultPage(default_page)
def last_migrate_layout(self): """Migrate the layout (view method). This needs to be done last, as otherwise our changes in migrate_criteria may get overriden by a later call to migrate_properties. """ old_layout = self.old.getLayout() or getattr(self.old, 'layout', None) if old_layout: default_page = self.old.getDefaultPage() or \ getattr(self.old, 'default_page', None) try: # Delete old-style layout attribute. del self.new.layout except AttributeError: pass self.new.setLayout(LISTING_VIEW_MAPPING.get( old_layout, old_layout)) # noqa if default_page: # any defaultPage is switched of by setLayout # and needs to set again self.new.setDefaultPage(default_page)