edx/edx-platform — pull request #1805 by sefk (2013-12-01 17:20:25+00:00)
Title: dump_course_structure cmd: "flat" structure, csv

For @rocha since this is adds onto your work (?). @jinpa if you care to comment on usefulness and such, please do.

This adds two options to the existing management command for dumping out a course structure, "csv" and "flat". The "flat" option is another format for listing out a course that we found helpful for ad-hoc reporting. It has convenient module_id to description mappings, and has the level so you have some notion of where

This is the output of this command:
```./manage.py lms --settings=cms.dev dump_course_structure --flat Medicine/SciWrite/Fall2013 --csv | head```

in my dev environment:

course_id,position,level,module_id,type,displayname,path,parent
Medicine/SciWrite/Fall2013,0,0,Medicine/SciWrite/Fall2013,course,Writing in the Sciences,,
Medicine/SciWrite/Fall2013,1,1,i4x://Medicine/SciWrite/chapter/bfb45ea5331b4fa8946e4a4c2f60add1,chapter,Getting Started,Getting Started,Medicine/SciWrite/Fall2013
Medicine/SciWrite/Fall2013,2,2,i4x://Medicine/SciWrite/sequential/eb0ff3535f98436993e0504bccc0704d,sequential,Pre-course assessment,"Getting Started,Pre-course assessment",i4x://Medicine/SciWrite/chapter/bfb45ea5331b4fa8946e4a4c2f60add1
Medicine/SciWrite/Fall2013,3,3,i4x://Medicine/SciWrite/vertical/174d22b53c8e4bda9cfefe4a11342ff2,vertical,Starting point assessment,"Getting Started,Pre-course assessment,Starting point assessment",i4x://Medicine/SciWrite/sequential/eb0ff3535f98436993e0504bccc0704d
Medicine/SciWrite/Fall2013,4,4,i4x://Medicine/SciWrite/html/aff2a837288e4ca482d1a1ea6c781f85,html,Text,"Getting Started,Pre-course assessment,Starting point assessment,Text",i4x://Medicine/SciWrite/vertical/174d22b53c8e4bda9cfefe4a11342ff2
Medicine/SciWrite/Fall2013,5,4,i4x://Medicine/SciWrite/html/0a027e1ef69c4a2fbd60281300e00e69,html,Starting point assessment,"Getting Started,Pre-course assessment,Starting point assessment,Starting point assessment",i4x://Medicine/SciWrite/vertical/174d22b53c8e4bda9cfefe4a11342ff2
Medicine/SciWrite/Fall2013,6,2,i4x://Medicine/SciWrite/sequential/9b3ac8e639fc46888e9ef3603765c636,sequential,Pre-course survey,"Getting Started,Pre-course survey",i4x://Medicine/SciWrite/chapter/bfb45ea5331b4fa8946e4a4c2f60add1
Medicine/SciWrite/Fall2013,7,3,i4x://Medicine/SciWrite/vertical/c5aacc093d124126991d9bf41f76fe36,vertical,Survey,"Getting Started,Pre-course survey,Survey",i4x://Medicine/SciWrite/sequential/9b3ac8e639fc46888e9ef3603765c636
Medicine/SciWrite/Fall2013,8,4,i4x://Medicine/SciWrite/html/589be58d3353441a8bf50e657c7aee8b,html,Survey,"Getting Started,Pre-course survey,Survey,Survey",i4x://Medicine/SciWrite/vertical/c5aacc093d124126991d9bf41f76fe36

The "position" is so you can sort reports in the order that they would be presented in the course.