Faculty2 - #!/usr/bin/env python "...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
#!/usr/bin/env python """ http://docs.python.org/library/xml.dom.html http://docs.python.org/library/xml.dom.minidom.html """ from google.appengine.ext import db from xml.dom.minidom import parse #import types debug = False class Person(db.Model) : username = db.StringProperty() research_area = db.StringProperty() research_group = db.StringProperty() title = db.StringProperty() class Email(db.Model): person = db.ReferenceProperty(Person, collection_name='emails') address = db.StringProperty() class PhoneNumber(db.Model): #the person attribute is what relates a phone number to a person as a collection #it dynamically creates an attribute in the Person class called phone_numbers #that is iterable person = db.ReferenceProperty(Person, collection_name='phone_numbers') phone_t = db.StringProperty(choices=('home','work','cell','fax','pager')) country_code = db.StringProperty() area_code = db.StringProperty() number = db.StringProperty() class Degree(db.Model): person = db.ReferenceProperty(Person, collection_name='degrees') date_awarded = db.StringProperty() institution = db.StringProperty() degree_t = db.StringProperty(choices=("Certificate of Completion","Associate's Degree", "Bachelor's Degree", "Master's Degree", "Doctoral Degree","Honorary Degree","Laurea")) specialization = db.StringProperty() class Website(db.Model): person = db.ReferenceProperty(Person, collection_name='websites') url = db.StringProperty() group = db.StringProperty() class Writing(db.Model): person = db.ReferenceProperty(Person, collection_name='writings') title = db.StringProperty() writing = db.StringProperty(choices=('thesis','article','tech report','editorial','book')) class Name(db.Expando): person = db.ReferenceProperty(Person, collection_name='names') website = db.ReferenceProperty(Website, collection_name='website_authors') writing = db.ReferenceProperty(Writing, collection_name='writing_authors') first_name = db.StringProperty()
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
middle_name = db.StringProperty() last_name = db.StringProperty() suffix = db.StringProperty() class Schedule(db.Model): #event = db.ReferenceProperty(Event, collection_name='schedule_events') start_time = db.StringProperty() end_time = db.StringProperty() day = db.StringProperty(choices=('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday')) start_date = db.StringProperty() end_date = db.StringProperty() class Building(db.Model): building_abbr = db.StringProperty() building_name = db.StringProperty() class Location(db.Expando): building = db.ReferenceProperty(Building) person = db.ReferenceProperty(Person, collection_name='offices') #event = db.ReferenceProperty(Event, collection_name='events') floor = db.StringProperty() room = db.StringProperty() class Event(db.Model): person = db.ReferenceProperty(Person, collection_name='office_hours') event_t = db.StringProperty(choices=('Office Hours', 'Meeting', 'Seminar')) schedule = db.ReferenceProperty(Schedule) location = db.ReferenceProperty(Location) class Class(db.Model): person = db.ReferenceProperty(Person, collection_name='classes')
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/05/2010 for the course CS 373 taught by Professor Downing,glennp during the Fall '08 term at University of Texas.

Page1 / 14

Faculty2 - #!/usr/bin/env python "...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online