|Version 2 (modified by 12 years ago) ( diff ),|
The SahanaPy Admin Guide
Approve a Pending User's registration:
Find user & remove the 'Pending' flag
Imported unstructured data via an 'Import Job'
Import jobs provide a mechanism for unstructured data from a CSV file to be imported into a Sahana model. Import jobs work by allowing you to map each column in the CSV (the first line is assumed to be column headers) to the corresponding model field.
An import job follows 5 steps:
- Create Job
- In the administration section of Sahana choose 'Database > Import' from the menu.
- In the bottom (third) section of the resulting page, select the module and resource that you wish to import data to.
- Provide a description for this import job that identifies the source of data (e.g. OCHA Organisations - 2010-01-25)
- Select the file to upload
- Click the 'Upload' button.
- Map CSV Headers to Resource (Model) Fields
- After the upload completes you will be taken to the import job page, where a list of the headers read from the CSV file is displayed in a table. To the right of each CSV header, is a select box listing the available model fields the data can be imported to. Some basic matching is performed to attempt to guess which CSV columns match which model fields.
- Modify the values of the select boxes until they reflect the correct destination for each CSV column. You can select the special 'None (Ignore)' entry to cause all the data in a particular CSV column to be ignored.
- Click the 'Begin Processing' button.
- Data Processing and Validation
- A background task on the Sahana server will process your uploaded file and validate each line. This step may take 5-10 minutes as the background task only runs at specific intervals. While you are waiting the page will automatically refresh every 60 seconds until the uploaded file has been processed.
- Select lines for import
- Once the file has been processed, you will be presented with a list of lines that were found. For each line a select box is presented allowing you to choose to 'import' or 'ignore' the line.
- Lines which failed validation will automatically be ignored. A list of the invalid fields will be displayed in the 'Errors' column.
- For each valid line, satisfy yourself that the data is good and should be imported. If it is not, change the select box to 'ignore'
- Click the 'Import' button at the bottom of the page.
- Data Import
- A background task on the Sahana server will process the lines selected for import. This step may take 5-10 minutes as the background task only runs at specific intervals. While you are waiting the page will automatically refresh every 60 seconds until the uploaded file has been processed.
If all lines were imported sucessfully, you will be taken to a page stating that the job state is 'finished'. A list of all the lines will be displayed below with their status set to 'imported' or 'ignored' as appropriate.
If some lines failed to import, you will be taken back to Step 4. You will note that most lines are now set to 'imported'. The lines that failed to import will have error text in the 'Errors' column. You can choose to attempt a 2nd import of them, or change their status to 'ignore' before clicking the 'Import' button again to retry.