From 63c3bf550eb2615af474e219dc1e9ea709395154 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 26 Jun 2010 17:39:49 -0400 Subject: [PATCH] A first attempt at MySQL -> Professor() conversion --- sitecore/prof/export_mysql.py | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/sitecore/prof/export_mysql.py b/sitecore/prof/export_mysql.py index 70bd392..15af27c 100644 --- a/sitecore/prof/export_mysql.py +++ b/sitecore/prof/export_mysql.py @@ -157,7 +157,38 @@ Where the relevant categories are 'Adjunct Professor']: for prof in db.list_entries({'category':category}): p = Professor() - TODO + p.name = Name( + first_middle=prof['firstname'], + last=prof['lastname'], + ) + p.title = prof['position1'] + if len(prof['position2']) > 0: + p.title += ', %s' % prof['position2'] + p.graduations = [] + print prof['degrees'] + for degree in prof['degrees']: + g.greaduations.append( + Graduation( + college=None, + title=None, + year=None, + ) + ) + p.contact = Contact( + office=prof['office'], + email=prof['email'], + website=prof['personalpage'], + phone=prof['phone'], + lab=prof['lab'], + lab_phone=prof['labphone'], + ) + p.bio = Bio( + specialization=prof['research'], # prof['grouppage'] + publications=None, + profile=prof['profile'], + cv=None, + ) + self.logger.debug(unicode(p)) yield p -- 2.26.2