From: W. Trevor King Date: Sat, 26 Jun 2010 21:39:49 +0000 (-0400) Subject: A first attempt at MySQL -> Professor() conversion X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=63c3bf550eb2615af474e219dc1e9ea709395154;p=sitecorepy.git A first attempt at MySQL -> Professor() conversion --- 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