Navigation Menu

Skip to content
Haris Ibrahim K. V edited this page Sep 13, 2015 · 12 revisions

This Wiki refers to https://github.com/klpdotorg/dubdubdub/issues/465. It lists out the management commands that needs to be run in order to import data from IVRS and Community sheets.

IVRS (version 1)

  • python manage.py populateivrsdata

Populates the db with questions for IVRS.

  • python manage.py fetchivrs [--from=20/12/2014 --to=21/12/2014]

If dates not mentioned, tries to fetch the IVRS data for 'today'. Otherwise fetches the IVRS data from the the API for the given dates, and creates the corresponding Answers & Stories in the db.

Unmatched school IDs will be available in the ivrs_errors.log file within the project root.

IVRS (version 2)

  • python manage.py populategkaivrsdata

Populates the db with questions for IVRS.

  • python manage.py fetchgkaivrs

Supposed to run as a cronjob. Checks the currently present State instances present in the ivrs app and determines the ones that need to be saved as Stories. Deletes the expired States.

IVRS (version 3)

  • python manage.py populatenewivrsdata

Populates the db with questions for IVRS. Year 2015 - 2016.

Community Feedback (version 1)

  • python manage.py populatecommunitydatav1

Populates the db with questions for community feedback V1.

  • python manage.py fetchcommunityv1 --file=path_to_file

Pass in the file path as an argument. Fetches the community feedback data for version 1 and creates the corresponding Answers & Stories in the db.

Unmatched school IDs will be available in the school_errors.log file within the project root.

Community Feedback (version 2)

  • python manage.py populatecommunitydatav2

Populates the db with questions for community feedback V2.

  • python manage.py fetchcommunityv2 --file=path_to_file --format=Hosakote1/Hosakote1-dates/Hosakote2/v2/GKA1/GKA2

Pass in the file path as an argument. Pass in the format for the respective sheet that you are importing.

  • Hosakote 2015 for the months April, May and June is 'Hosakote1-dates'.
  • Hosakote 2015 is 'Hosakote1'. Other Hosakotes are 'Hosakote2'.
  • GKA 2015 is 'GKA1'. The other is 'GKA2'.
  • Kustagi, Mundaragi and the first v2 sheet are all 'v2'.

Fetches the community feedback data for version 2 and creates the corresponding Answers & Stories in the db.

Unmatched DISE codes and unmatched dise-school/school codes will be available in error_.log file.

Community Feedback (version 4. Before you ask, version 3 is considered to be the Anganwadi one below)

  • python manage.py populatecommunitydatav4

Populates the db with questions for community feedback V4.

  • python manage.py fetchcommunityv4 --file=path_to_file

Pass in the file path as an argument.

Anganwadi Infrastructure data

Refer to https://github.com/klpdotorg/dubdubdub/issues/507

  • python manage.py populateanganwadiv1
  • python manage.py populateanganwadimallur
  • python manage.py populateanganwadibangalore

The above 3 populates the db with questions for all the anganwadi infrastructure surveys.

  • python manage.py fetchanganwadi --file=path_to_file --format=v1/mallur/bangalore

Pass in the file path as an argument. Pass in the format for the respective sheet that you are importing.

  • 2012 - 2013 is 'v1'.
  • 2013 - 2014 Mallur is 'mallur'.
  • 2013 - 2014 Bangalore is 'bangalore'.

Answer Merge

  • python manage.py answermerge

Merges identical answers in the db. Refer to https://github.com/klpdotorg/dubdubdub/issues/450

Auto update Questiongroup date ranges

  • python manage.py updatequestiongroup

Finds the earliest and latest stories for each Questiongroup and assigns them to that Questiongroup's start_date and end_date respectively. Refer to https://github.com/klpdotorg/dubdubdub/issues/550

Import Question Metadata (keys and display text)

python manage.py import_question_metadata --file=/path/to/file

This imports the keys and display texts specified in the CSV file (downloaded as CSV from https://docs.google.com/spreadsheets/d/1F5ECy2_Vq23lDJCVQTyZ9K29CIlb_lsmdaLc6PNtVkQ/ )