Updated AJAX API to make a single, big request instead of multiple smaller ones.
diff --git a/GSoC2010DataSeeder.wiki b/GSoC2010DataSeeder.wiki index fbbb076..b882f2e 100644 --- a/GSoC2010DataSeeder.wiki +++ b/GSoC2010DataSeeder.wiki
@@ -226,110 +226,91 @@ == AJAX API == - * _*/get_models_* - * Returns a list of models that can be seeded. + * _*/get_data_* + * Returns a list of models (including details such as properties) that can be seeded and a list of available data providers for each property type. * Input: N/A * Output: {{{ { - "models" : [ - "models.student.Student": - { - "name": "Student", - "description": "Student details for a specific Program." - "parent": "Role" - }, - "models.linkable.Linkable": - { - "name": "Linkable", - "description": "...", - "parent": "base.ModelWithFieldAttributes" - } - "models.base.ModelWithFieldAttributes": - { - "name": "ModelWithFieldAttributes", - "description": "...", - "parent": null - }, - ... - ] + "models" : [ + "models.student.Student": + { + "name": "Student", + "description": "Student details for a specific Program.", + "parent": "models.role.Role", + "properties": [ + "school_name": { + "name": "School name", + "type": "StringProperty", + "group": "5. Education", + "required": true, + "description": "..." + }, + "school_type": { + "name" : "School Type", + "type": "StringProperty", + "group": "5. Education", + "required": false, + "choices": ["University", "High School"], + "description": "..." + }, + ... + ] + }, + "models.linkable.Linkable": + { + "name": "Linkable", + "description": "...", + "parent": "models.base.ModelWithFieldAttributes", + "properties" : [ + ... + ] + } + "models.base.ModelWithFieldAttributes": + { + "name": "ModelWithFieldAttributes", + "description": "...", + "parent": null + "properties" : [ + ... + ] + }, + ... + ], + "providers" : [ + "StringProperty": [ + "FixedStringProvider": { + "name": "Fixed string providers", + "description": "Returns a fixed string.", + "parameters" : [ + "value": { + "name": "Value", + "description": "The value of the string to return", + "required": true + } + ] + }, + "RandomWordProvider": { + "name": "Random word provider", + "description": "Returns a random word.", + "parameters" : [ + "choices": { + "name": "Choices", + "description": "A list of words to choose from", + "required": false + } + ] + } + ... + ], + "IntegerProperty" : [ + ... + ], + ... + ] } }}} - * _*/get_properties*_ - * Returns a list of properties for a specific model. - * Input: -{{{ -{ - "model": "models.student.Student" -} -}}} - * Output: -{{{ -{ - "model": "models.student.Student", - "properties": [ - "school_name": { - "name": "School name", - "type": "StringProperty", - "group": "5. Education", - "required": true, - "description": "..." - }, - "school_type": { - "name" : "School Type", - "type": "StringProperty", - "group": "5. Education", - "required": false, - "choices": ["University", "High School"], - "description": "..." - }, - ... - ] -} -}}} - - * _*/get_data_providers*_ - * Returns a list of possible data providers for a property type. - * Input: -{{{ -{ - "type": "StringProperty" -} -}}} - * Output: -{{{ -{ - "type": "StringProperty", - "data_providers": [ - "FixedStringProvider": { - "name": "Fixed string providers", - "description": "Returns a fixed string.", - "parameters" : [ - "value": { - "name": "Value", - "description": "The value of the string to return", - "required": true - } - ] - }, - "RandomWordProvider": { - "name": "Random word provider", - "description": "Returns a random word.", - "parameters" : [ - "choices": { - "name": "Choices", - "description": "A list of words to choose from", - "required": false - } - ] - } - ... - ] -} -}}} - - = Proposed timeline = == Week 1 (24 May - 30 May) ==