|
| 1 | +class LegacyRouter(object): |
| 2 | + legacy_apps = ["idindex", "idtracker", "ietfauth", ""] |
| 3 | + legacy_models = ["AnnouncedFrom", "AnnouncedTo", "Announcement", "ScheduledAnnouncement", |
| 4 | + "TelechatDates"] |
| 5 | + |
| 6 | + def db_for_read(self, model, **hints): |
| 7 | + if model._meta.db_table in legacy_tables: |
| 8 | + return 'legacy' |
| 9 | + return None |
| 10 | + |
| 11 | + def db_for_write(self, model, **hints): |
| 12 | + if model._meta.db_table in legacy_tables: |
| 13 | + raise Exception("You can't write to the legacy table %s" % model._meta.db_table) |
| 14 | + return None |
| 15 | + |
| 16 | + def allow_relation(self, obj1, obj2, **hints): |
| 17 | + if (obj1._meta.db_table in legacy_tables) != (obj2._meta.db_table in legacy_tables): |
| 18 | + return False |
| 19 | + return None |
| 20 | + |
| 21 | + def allow_syncdb(self, db, model): |
| 22 | + if db == 'legacy': |
| 23 | + return False |
| 24 | + if model._meta.db_table in legacy_tables: |
| 25 | + return False |
| 26 | + return None |
| 27 | + |
| 28 | +legacy_tables = set(( |
| 29 | + "acronym", |
| 30 | + "agenda_cat", |
| 31 | + "agenda_items", |
| 32 | + "all_id", |
| 33 | + "announced_from", |
| 34 | + "announced_to", |
| 35 | + "announcements", |
| 36 | + "area_directors", |
| 37 | + "area_group", |
| 38 | + "area_status", |
| 39 | + "areas", |
| 40 | + "ballot_info", |
| 41 | + "ballots", |
| 42 | + "ballots_comment", |
| 43 | + "ballots_discuss", |
| 44 | + "bash_agenda", |
| 45 | + "chairs", |
| 46 | + "chairs_history", |
| 47 | + "document_comments", |
| 48 | + "draft_versions_mirror", |
| 49 | + "dt_request", |
| 50 | + "email_addresses", |
| 51 | + "from_bodies", |
| 52 | + "g_chairs", |
| 53 | + "g_editors", |
| 54 | + "g_secretaries", |
| 55 | + "g_secretary", |
| 56 | + "g_status", |
| 57 | + "g_tech_advisors", |
| 58 | + "g_type", |
| 59 | + "general_info", |
| 60 | + "goals_milestones", |
| 61 | + "group_flag", |
| 62 | + "group_internal", |
| 63 | + "groups_ietf", |
| 64 | + "hit_counter", |
| 65 | + "id_approved_detail", |
| 66 | + "id_authors", |
| 67 | + "id_dates", |
| 68 | + "id_intended_status", |
| 69 | + "id_internal", |
| 70 | + "id_restricted_word", |
| 71 | + "id_status", |
| 72 | + "id_submission_detail", |
| 73 | + "id_submission_env", |
| 74 | + "id_submission_status", |
| 75 | + "idst_users", |
| 76 | + "iesg_history", |
| 77 | + "iesg_login", |
| 78 | + "iesg_password", |
| 79 | + "iesg_telechatdate", |
| 80 | + "ietfauth_ietfuserprofile", |
| 81 | + "ietfauth_usermap", |
| 82 | + "ietfworkflows_annotationtag", |
| 83 | + "ietfworkflows_annotationtagobjectrelation", |
| 84 | + "ietfworkflows_objectannotationtaghistoryentry", |
| 85 | + "ietfworkflows_objecthistoryentry", |
| 86 | + "ietfworkflows_objectstreamhistoryentry", |
| 87 | + "ietfworkflows_objectworkflowhistoryentry", |
| 88 | + "ietfworkflows_statedescription", |
| 89 | + "ietfworkflows_stateobjectrelationmetadata", |
| 90 | + "ietfworkflows_stream", |
| 91 | + "ietfworkflows_streamdelegate", |
| 92 | + "ietfworkflows_streamedid", |
| 93 | + "ietfworkflows_wgworkflow", |
| 94 | + "ietfworkflows_wgworkflow_selected_states", |
| 95 | + "ietfworkflows_wgworkflow_selected_tags", |
| 96 | + "imported_mailing_list", |
| 97 | + "interim_info", |
| 98 | + "interim_meetings_acronym", |
| 99 | + "interim_meetings_groups_ietf", |
| 100 | + "interim_meetings_interim_info", |
| 101 | + "interim_meetings_interim_new", |
| 102 | + "interim_meetings_meetings", |
| 103 | + "interim_meetings_minutes", |
| 104 | + "interim_meetings_slides", |
| 105 | + "internet_drafts", |
| 106 | + "ipr_contacts", |
| 107 | + "ipr_detail", |
| 108 | + "ipr_ids", |
| 109 | + "ipr_licensing", |
| 110 | + "ipr_notifications", |
| 111 | + "ipr_rfcs", |
| 112 | + "ipr_selecttype", |
| 113 | + "ipr_updates", |
| 114 | + "irtf", |
| 115 | + "irtf_chairs", |
| 116 | + "liaison_detail", |
| 117 | + "liaison_detail_temp", |
| 118 | + "liaison_managers", |
| 119 | + "liaison_purpose", |
| 120 | + "liaisons_interim", |
| 121 | + "liaisons_members", |
| 122 | + "liaisons_outgoingliaisonapproval", |
| 123 | + "liaisons_sdoauthorizedindividual", |
| 124 | + "lists_email", |
| 125 | + "lists_email_refs", |
| 126 | + "lists_list", |
| 127 | + "mailing_list", |
| 128 | + "mailinglists_domain", |
| 129 | + "mailinglists_domain_approvers", |
| 130 | + "management_issues", |
| 131 | + "meeting_agenda_count", |
| 132 | + "meeting_attendees", |
| 133 | + "meeting_conflict", |
| 134 | + "meeting_conflict_groups", |
| 135 | + "meeting_hours", |
| 136 | + "meeting_rooms", |
| 137 | + "meeting_sessionstatusname", |
| 138 | + "meeting_times", |
| 139 | + "meeting_venues", |
| 140 | + "meetings", |
| 141 | + "messages", |
| 142 | + "migrate_stat", |
| 143 | + "minutes", |
| 144 | + "nomcom", |
| 145 | + "nomcom_members", |
| 146 | + "non_session", |
| 147 | + "non_session_ref", |
| 148 | + "none_wg_mailing_list", |
| 149 | + "not_meeting_groups", |
| 150 | + "old_document_comments", |
| 151 | + "outstanding_tasks", |
| 152 | + "permissions_objectpermission", |
| 153 | + "permissions_objectpermissioninheritanceblock", |
| 154 | + "permissions_permission", |
| 155 | + "permissions_permission_content_types", |
| 156 | + "permissions_principalrolerelation", |
| 157 | + "permissions_role", |
| 158 | + "person_or_org_info", |
| 159 | + "phone_numbers", |
| 160 | + "postal_addresses", |
| 161 | + "print_name", |
| 162 | + "prior_address", |
| 163 | + "proceedings", |
| 164 | + "pwg_cat", |
| 165 | + "ref_doc_states_new", |
| 166 | + "ref_next_states_new", |
| 167 | + "ref_resp", |
| 168 | + "replaced_ids", |
| 169 | + "request", |
| 170 | + "rfc_authors", |
| 171 | + "rfc_editor_queue_mirror", |
| 172 | + "rfc_editor_queue_mirror_refs", |
| 173 | + "rfc_index_mirror", |
| 174 | + "rfc_intend_status", |
| 175 | + "rfc_status", |
| 176 | + "rfcs", |
| 177 | + "rfcs_obsolete", |
| 178 | + "roll_call", |
| 179 | + "scheduled_announcements", |
| 180 | + "scheduled_announcements_temp", |
| 181 | + "sdo_chairs", |
| 182 | + "sdos", |
| 183 | + "secretariat_staff", |
| 184 | + "session_conflicts", |
| 185 | + "session_names", |
| 186 | + "session_request_activities", |
| 187 | + "session_status", |
| 188 | + "slide_types", |
| 189 | + "slides", |
| 190 | + "staff_work_detail", |
| 191 | + "staff_work_history", |
| 192 | + "sub_state", |
| 193 | + "switches", |
| 194 | + "task_status", |
| 195 | + "telechat", |
| 196 | + "telechat_dates", |
| 197 | + "telechat_minutes", |
| 198 | + "telechat_users", |
| 199 | + "temp_admins", |
| 200 | + "temp_agenda71166", |
| 201 | + "temp_id_authors", |
| 202 | + "temp_telechat_attendees", |
| 203 | + "temp_txt", |
| 204 | + "templates", |
| 205 | + "updated_ipr", |
| 206 | + "uploads", |
| 207 | + "uploads_temp", |
| 208 | + "users", |
| 209 | + "web_gm_chairs", |
| 210 | + "web_login_info", |
| 211 | + "web_user_info", |
| 212 | + "wg_agenda", |
| 213 | + "wg_meeting_sessions", |
| 214 | + "wg_meeting_sessions_temp", |
| 215 | + "wg_password", |
| 216 | + "wg_proceedings_activities", |
| 217 | + "wg_www_pages", |
| 218 | + "wgchairs_protowriteup", |
| 219 | + "wgchairs_wgdelegate", |
| 220 | + "workflows_state", |
| 221 | + "workflows_state_transitions", |
| 222 | + "workflows_stateinheritanceblock", |
| 223 | + "workflows_stateobjectrelation", |
| 224 | + "workflows_statepermissionrelation", |
| 225 | + "workflows_transition", |
| 226 | + "workflows_workflow", |
| 227 | + "workflows_workflowmodelrelation", |
| 228 | + "workflows_workflowobjectrelation", |
| 229 | + "workflows_workflowpermissionrelation", |
| 230 | +)) |
| 231 | + |
| 232 | + |
0 commit comments