Migrate rr reviews
hypha.apply.review.management.commands.migrate_rr_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_rrr_overall_yes': {'id': 'cec815a0-fab1-4142-9fc6-71319b054b2a', 'type': 'value', 'key': 'safe_value'}, 'field_rrr_overall_no': {'id': '6915acf0-9a19-4e73-8d2b-d96e39e3b00e', 'type': 'value', 'key': 'safe_value'}, 'field_rrr_objectives_rate': {'id': '71bfe95d-89c5-401b-ae7a-778e91d5c8c5', 'type': 'score'}, 'field_rrr_capacity_rate': {'id': '3aa164c1-4386-4046-997a-a2778e1d894e', 'type': 'score'}, 'field_rrr_justification_rate': {'id': '7cc12bb6-4c12-48aa-a269-1fd6d725abfe', 'type': 'score'}, 'field_rrr_feedback': {'id': 'comments', 'type': 'value', 'key': 'safe_value'}, 'field_rrr_objectives': {'id': '38339ef8-8b57-4098-afc8-c3956fdf8333', 'type': 'placeholder'}, 'field_rrr_capacity': {'id': 'f88a4436-cad8-4131-8a32-595c55810606', 'type': 'placeholder'}, 'field_rrr_justification': {'id': '8d4c9191-ce68-4788-a7f6-66cef5a66288', 'type': 'placeholder'}}
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},]