mirror of https://github.com/stijndcl/didier
				
				
				
			Add image processing
							parent
							
								
									5bfd3a92a9
								
							
						
					
					
						commit
						17b6ebac89
					
				| 
						 | 
					@ -0,0 +1,22 @@
 | 
				
			||||||
 | 
					from sqlalchemy.ext.asyncio import AsyncSession
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from database.engine import DBSession
 | 
				
			||||||
 | 
					from database.schemas import UforaCourse, UforaCourseAlias
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					__all__ = ["main"]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def main():
 | 
				
			||||||
 | 
					    """Add the Image Processing course"""
 | 
				
			||||||
 | 
					    session: AsyncSession
 | 
				
			||||||
 | 
					    async with DBSession() as session:
 | 
				
			||||||
 | 
					        image_proc = UforaCourse(
 | 
				
			||||||
 | 
					            code="E010310", name="Image Processing", year=6, compulsory=False, role_id=1155595071228498134
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        session.add(image_proc)
 | 
				
			||||||
 | 
					        await session.commit()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        image_proc_alias = UforaCourseAlias(course_id=image_proc.course_id, alias="Beeldverwerking")
 | 
				
			||||||
 | 
					        session.add(image_proc_alias)
 | 
				
			||||||
 | 
					        await session.commit()
 | 
				
			||||||
		Loading…
	
		Reference in New Issue