Changes between Version 1 and Version 2 of DeveloperGuidelines/PrePopulate
- Timestamp:
- 03/24/12 04:54:26 (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DeveloperGuidelines/PrePopulate
v1 v2 3 3 4 4 == Introduction == 5 We need to be able to import data into a Sahana Eden instance for testing, demos and to help with getting up and running. 6 7 == Types of Data == 5 We need to be able to import data into a Sahana Eden instance for testing, demos and to help with getting up and running such as: 8 6 * Item Catalogue 9 7 * Organisation List … … 15 13 == Methods == 16 14 === On First Run === 17 In models/000_config.py their is a deployment setting whichis used to control prepopulate. This is a list of directory names and will import data from a number of CSV files. The directories must be in the private/prepopulate directory tree and must include a file called tasks.cfg.15 In models/000_config.py {{{deployment_settings.base.prepopulate}}} is used to control prepopulate. This is a list of directory names and will import data from a number of CSV files. The directories must be in the private/prepopulate directory tree and must include a file called tasks.cfg. 18 16 19 17 The prepopulate deployment setting can also be a number which will relate to a single directory, the numerical value is still supported because existing instances of Eden and their maintenance scripts use this number. The use of a number is discouraged in favour of the list of names because this new approach is clearer and more flexible. … … 36 34 * Special Import Jobs 37 35 The tasks.cfg file supports the # character on the first column as a comment. 36 37 ==== Prepopulate folders ==== 38 Within the private/prepopulate there are a number of different folder: 39 * '''default''' - data which will be needed in the deployment 40 * '''demo''' - data which will not be prepopulated in a live deployment, but which is useful for developers. 41 * '''regression''' - data for testing 42 * '''roles''' - data for setting up roles for different types of permissions. 43 The {{{private/prepopulate/default/Default}}} folder contains default data which is needed by all instances of Sahana Eden, so you should always include {{{default/Default}}} in the {{{deployment_settings.base.prepopulate}}} list. 44 38 45 ==== Basic Importer Jobs ==== 39 46 These will use the UI Importer to load in the data and requires the following information: … … 91 98 * Then a configuration file can be created where you can just list the CSV file names which you want to be imported when Sahana Eden is initialized. Copies of this files could be saved in the private/prepopulate/<deployment>/ directory then a config setting could select which file to use, to make it easy to set up Sahana Eden to have different types of data in it. 92 99 100 ---- 101 See: 102 * BluePrint/PrePopulate 103 93 104