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 = self.old.getLayout() or getattr(self.old, 'layout', None) if old_layout in LISTING_VIEW_MAPPING.keys(): default_page = self.old.getDefaultPage() or \ getattr(self.old, 'default_page', None) self.new.setLayout(LISTING_VIEW_MAPPING[old_layout]) 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. """ if self.old.getCustomView(): # Previously, the atct_topic_view had logic for showing # the results in a list or in tabular form. If # getCustomView is True, this means the new object should # use the tabular view. self.new.setLayout('tabular_view') return old_layout = self.old.getLayout() or getattr(self.old, 'layout', None) if old_layout in LISTING_VIEW_MAPPING.keys(): self.new.setLayout(LISTING_VIEW_MAPPING[old_layout])
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)