### Navigation

- index
- modules |
- Camelot documentation »

# wizard Package

## `wizard` Package

The wizard module contains generic wizards and wizard pages

## `backup` Module

class `camelot.view.wizard.backup.``BackupPage`(backup_mechanism, parent=None)

  Bases: `camelot.view.wizard.pages.progress_page.ProgressPage`

  `run`()
  `title` = _('Backup in progress')

class `camelot.view.wizard.backup.``BackupWizard`(backup_mechanism, parent=None)

  Bases: `PyQt4.QtGui.QWizard`

  Wizard to perform a backup using a BackupMechanism

  `backup_page`

    alias of `BackupPage`

  `select_backup_file_page`

    alias of `SelectBackupFilePage`

  `window_title` = _('Backup')

class `camelot.view.wizard.backup.``RestorePage`(backup_mechanism, parent=None)

  Bases: `camelot.view.wizard.pages.progress_page.ProgressPage`

  `run`()
  `title` = _('Restore in progress')

class `camelot.view.wizard.backup.``RestoreWizard`(backup_mechanism, parent=None)

  Bases: `PyQt4.QtGui.QWizard`

  Wizard to perform a restore using a BackupMechanism

  `restore_page`

    alias of `RestorePage`

  `select_restore_file_page`

    alias of `SelectRestoreFilePage`

  `window_title` = _('Restore')

## `importwizard` Module

Module for managing imports

class `camelot.view.wizard.importwizard.``CsvCollectionGetter`(filename)

  Bases: `object`

  Returns data from csv file as a list of RowData objects

class `camelot.view.wizard.importwizard.``DataPreviewCollectionProxy`(*args, **kwargs)

  Bases: `camelot.view.proxy.collection_proxy.CollectionProxy`

  `header_icon` = None

class `camelot.view.wizard.importwizard.``DataPreviewPage`(parent=None, model=None, collection_getter=None)

  Bases: `PyQt4.QtGui.QWizardPage`

  DataPreviewPage is the previewing page for the import wizard

  `initializePage`()

    Gets all info needed from SelectFilePage and feeds table

  `isComplete`()
  `update_complete`(row=0)
  `validatePage`()
  `validate_all_rows`()

class `camelot.view.wizard.importwizard.``FinalPage`(parent=None, model=None, admin=None)

  Bases: `camelot.view.wizard.pages.progress_page.ProgressPage`

  FinalPage is the final page in the import process

  `run`()
  `sub_title` = _('Please wait while data is being imported.')
  `title` = _('Import Progress')

class `camelot.view.wizard.importwizard.``ImportWizard`(parent=None, admin=None)

  Bases: `PyQt4.QtGui.QWizard`

  ImportWizard provides a two-step wizard for importing data as objects into Camelot. To create a custom wizard, subclass this ImportWizard and overwrite its class attributes.

  To import a different file format, you probably need a custom collection_getter for this file type.

  `add_pages`(model, admin)

    Add all pages to the import wizard, reimplement this method to add custom pages to the wizard. This method is called in the __init__ method, to add all pages to the wizard.

    Parameters: | model – the CollectionProxy that will be used to display the to

    be imported data :param admin: the admin of the destination data

  `collection_getter`

    alias of `CsvCollectionGetter`

  `data_preview_page`

    alias of `DataPreviewPage`

  `final_page`

    alias of `FinalPage`

  `rowdata_admin_decorator`

    alias of `RowDataAdminDecorator`

  `select_file_page`

    alias of `SelectFilePage`

  `window_title` = u'Import CSV data'

class `camelot.view.wizard.importwizard.``RowData`(row_number, row_data)

  Bases: `object`

  Class representing the data in a single row of the imported file as an object with attributes column_1, column_2, ..., each representing the data in a single column of that row.

  since the imported file might contain less columns than expected, the RowData object returns None for not existing attributes

class `camelot.view.wizard.importwizard.``RowDataAdminDecorator`(object_admin)

  Bases: `object`

  Decorator that transforms the Admin of the class to be imported to an Admin of the RowData objects to be used when previewing and validating the data to be imported.

  based on the field attributes of the original mode, it will turn the background color pink if the data is invalid for being imported.

  `create_validator`(model)

    Creates a validator that validates the data to be imported, the validator will check if the background of the cell is pink, and if it is it will mark that object as invalid.

  `delete`(obj)
  `flush`(obj)

    When flush is called, don’t do anything, since we’ll only save the object when importing them for real

  `get_columns`()
  `get_dynamic_field_attributes`(obj, field_names)
  `get_field_attributes`(field_name)
  `get_fields`()
  `get_static_field_attributes`(field_names)
  `new_field_attributes`(i, original_field_attributes, original_field)

class `camelot.view.wizard.importwizard.``UTF8Recoder`(f, encoding)

  Iterator that reads an encoded stream and reencodes the input to UTF-8.

  `next`()

class `camelot.view.wizard.importwizard.``UnicodeReader`(f, dialect=<class csv.excel at 0xd0731ac>, encoding='utf-8', **kwds)

  A CSV reader which will iterate over lines in the CSV file “f”, which is encoded in the given encoding.

  `next`()

class `camelot.view.wizard.importwizard.``XlsCollectionGetter`(filename, encoding='utf-8')

  Bases: `object`

  Returns the data from excel file as a list of RowData objects

## `merge_document` Module

Wizard to merge documents with a list of objects.

This wizard is triggered thru an entry in the main menu.

class `camelot.view.wizard.merge_document.``MergeDocumentWizard`(parent=None, selection_getter=None)

  Bases: `PyQt4.QtGui.QWizard`

  This wizard lets the user select a template file, it then merges that template will all the selected rows in a table

  `window_title` = _('Merge Document')

class `camelot.view.wizard.merge_document.``MergePage`(parent, selection_getter)

  Bases: `camelot.view.wizard.pages.progress_page.ProgressPage`

  Wait until merge is complete

  `run`()
  `title` = _('Merge in progress')

class `camelot.view.wizard.merge_document.``SelectTemplatePage`(parent=None)

  Bases: `camelot.view.wizard.pages.select.SelectFilePage`

  Page to select the template to merge

  `icon` = Icon('tango/32x32/mimetypes/x-office-document-template.png')
  `sub_title` = _('Click 'Browse' to select a template file, then click 'Next'.')
  `title` = _('Merge a template document')

## `new` Module

Wizard and wizard pages to assist in the creation of new objects

class `camelot.view.wizard.new.``NewObjectWizard`(parent, admin)

  Bases: `PyQt4.QtGui.QWizard`

class `camelot.view.wizard.new.``SelectSubclassPage`(parent, admin)

  Bases: `PyQt4.QtGui.QWizardPage`

  Page for a wizard that allows the selection of a subclass

## `new_company` Module

## `update_value` Module

A wizard to update a field on a collection of objects

class `camelot.view.wizard.update_value.``ReplaceContentsData`

  Bases: `object`

class `camelot.view.wizard.update_value.``ReplaceContentsPage`(parent, collection_getter, data)

  Bases: `camelot.view.wizard.pages.update_entities_page.UpdateEntitiesPage`

  `title` = _('Replace field contents')
  `update_entity`(obj)

class `camelot.view.wizard.update_value.``SelectValuePage`(parent, admin, data)

  Bases: `PyQt4.QtGui.QWizardPage`

  Page to select a value to update

  `field_changed`(index)
  `set_fields`(fields)
  `sub_title` = _('Select the field to update and enter its new value')
  `title` = _('Replace field contents')
  `value_changed`(value_editor=None)

class `camelot.view.wizard.update_value.``UpdateValueWizard`(parent=None, selection_getter=None, admin=None)

  Bases: `PyQt4.QtGui.QWizard`

  This wizard presents the user with a selection of the possible fields to update and a new value. Then this field is changed for all objects in a given collection

  `select_value_page`

    alias of `SelectValuePage`

  `window_title` = _('Replace')

## Subpackages

- pages Package
  - `pages` Package
  - `backup_page` Module
  - `form_page` Module
  - `progress_page` Module
  - `select` Module
  - `update_entities_page` Module

### Navigation

- index
- modules |
- Camelot documentation »

Comments
blog comments powered by Disqus