propman_db_model.py (2029B)
1 """ 2 ============================================================================= 3 Rowan Computer Science Dept Spring 2019 Senior Project Team 4 Rowan Curricular Proposal Mangagement System for Jack Myers rowan 5 6 Senior Team Members: 7 Team Lead: John Kubach 8 Scrum Master: Joshua Jackson 9 Developer: Alex Kulplin 10 Developer: Jeffrey Podwats 11 Developer: Alaina Smith 12 Developer: Kyle Butera 13 14 ----------------------------------------------------------------------------- 15 16 Description: 17 this is connecting the backend to frontend via the controler flask 18 Last edit: 4/18/19 19 ============================================================================= 20 """ 21 from sqlalchemy.ext.automap import automap_base 22 from sqlalchemy import create_engine 23 from sqlalchemy.inspection import inspect 24 25 engine = create_engine('mysql+pymysql://cs_user:happy29july@localhost/propman', isolation_level='READ_COMMITTED') 26 Base = automap_base() 27 Base.prepare(engine, reflect=True) 28 29 #Mapped classes 30 Consult_letter = Base.classes.consult_letter 31 Consult_letter_revision = Base.classes.consult_letter_revision 32 Assessement_form = Base.classes.assessment_form 33 Assessement_form_Revision = Base.classes.assessement_form_revision 34 Employee = Base.classes.employee 35 Library_form = Base.classes.library_form 36 Library_form_revision = Base.classes.library_form_revision 37 Proposal = Base.classes.proposal 38 Sponsor = Base.classes.sponsor 39 Supporting_document = Base.classes.supporting_document 40 Supporting_document_revision = Base.classes.supporting_document_revision 41 Program_guide = Base.classes.program_guide 42 Program_guide_revision = Base.classes.program_guide_revision 43 44 #Check mapped relationships 45 ''' 46 classes = [Consult_letter, Consult_letter_revision, Assessment_form, Assessment_form_revision, Employee, Library_form, Library_form_revision, Proposal, Sponsor, Supporting_document, Supporting_document_revision, Program_guide, Program_guide_revision] 47 48 for c in classes: 49 print('Relationships for %s' % str(c)) 50 print(inspect(c).relationships.items()) 51 '''