A first attempt at MySQL -> Professor() conversion
authorW. Trevor King <wking@drexel.edu>
Sat, 26 Jun 2010 21:39:49 +0000 (17:39 -0400)
committerW. Trevor King <wking@drexel.edu>
Sat, 26 Jun 2010 21:39:49 +0000 (17:39 -0400)
sitecore/prof/export_mysql.py

index 70bd392fce23dc7bfe804b44f119547e544309ae..15af27ca73b4c9ff57d78476bd9f68ab32520604 100644 (file)
@@ -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