Migrate fellowship application reviews
hypha.apply.review.management.commands.migrate_fellowship_application_reviews
¶
Command
¶
Bases: MigrateCommand
help
class-attribute
instance-attribute
¶
REVIEWFIELD_MAP
class-attribute
instance-attribute
¶
REVIEWFIELD_MAP = {'community_lab_review': {'submission': 'field_review_community_lab', 'recommendation': 'field_clr_recommendation', 'rec_map': {'1': 2, '0': 0}}, 'concept_note_review': {'submission': 'field_review_concept_note', 'recommendation': 'field_pr_recommendation', 'rec_map': {'2': 1, '1': 2, '0': 0}}, 'proposal_review': {'submission': 'field_review_proposal', 'recommendation': 'field_pr_recommendation', 'rec_map': {'2': 1, '1': 2, '0': 0}}, 'fellowship_application_review': {'submission': 'field_review_fellowship_app', 'recommendation': 'field_fr_overall_rate', 'rec_map': {'5': 2, '4': 2, '3': 1, '2': 0, '1': 0}}, 'fellowship_proposal_review': {'submission': 'field_review_fellowship', 'recommendation': 'field_fr_overall_rate', 'rec_map': {'5': 2, '4': 2, '3': 1, '2': 0, '1': 0}}, 'rapid_response_review': {'submission': 'field_review_rapid_response', 'recommendation': 'field_rrr_recommend', 'rec_map': {'3': 2, '2': 1, '1': 0}}}
STREAMFIELD_MAP
class-attribute
instance-attribute
¶
STREAMFIELD_MAP = {'field_fr_overall_no': {'id': 'f0533950-57f5-4bb7-81ec-2d3813490c88', 'type': 'value', 'key': 'safe_value'}, 'field_far_request_questions': {'id': 'ba789376-e3f9-434e-8da5-330811723b30', 'type': 'merge_value', 'key': 'safe_value'}}
REQUEST_QUESTION_MAP
class-attribute
instance-attribute
¶
REQUEST_QUESTION_MAP = {'3618': {0: 'Do the Goals and principles of the application align with the program?', 1: 'Does the application propose a unique contribution to the relevant field?', 2: 'Do you consider the application reasonable and realistic?', 3: 'General Comments'}, '3681': {0: 'What are the positive aspects of this application?', 1: 'What are the negative aspects of this application?', 2: 'What items must the applicant address, if any?'}}
add_arguments
¶
handle
¶
Source code in hypha/apply/review/management/commands/migration_review_base.py
process
¶
Source code in hypha/apply/review/management/commands/migration_review_base.py
get_user
¶
get_field_value
¶
Handles the following formats: field: {(safe_)value: VALUE} field: {target_id: ID} -- Drupal ForeignKey. Reference to other node or user entities. field: {tid: ID} -- or term ID. fk to Categories field: [] field: [{value|target_id|tid: VALUE},]