def personFactory(self, namegen, prefixgen, gendergen, count): first_name, last_name, full_name = namegen.generate() person_id = 'student%03d' % count person = BasicPerson(person_id, first_name, last_name) person.setPassword(person_id) person.gender = gendergen.generate() return person
def setUpSchool(app): sy = ISchoolYearContainer(app)['2005'] = SchoolYear( '2005', date(2005, 1, 1), date(2005, 1, 30)) term = sy['spring'] = Term('Spring', date(2005, 1, 1), date(2005, 1, 30)) term.addWeekdays(0, 1, 2, 3, 4) pc = app['persons'] teacher = pc['teacher'] = BasicPerson("teacher", "Mister", "T") s1 = pc['john'] = BasicPerson("john", "John", "Peterson") s2 = pc['pete'] = BasicPerson("pete", "Pete", "Johnson") contacts = IContactContainer(app) contact = Contact() contact.__name__ = 'pete_parent' contact.prefix = 'Ms.' contact.first_name = 'Susan' contact.middle_name = 'T.' contact.last_name = 'Johnson' contact.suffix = 'Jr.' contact.address_line_1 = '1 First St.' contact.address_line_2 = 'Apt. 1' contact.city = 'NY' contact.state = 'NY' contact.country = 'USA' contact.postal_code = '00000' contact.email = '*****@*****.**' contact.home_phone = '000-0000' contact.work_phone = '111-1111' contact.mobile_phone = '222-2222' contact.language = 'English' contacts['pete_parent'] = contact IContactable(s2).contacts.relate(contact, ACTIVE + PARENT, 'p') IContactable(s2).contacts.relate(IContact(teacher), ACTIVE + PARENT, 'p') d1 = IDemographics(s1) d1['ID'] = "112323" d1['ethnicity'] = u'Asian' d1['language'] = "English" d1['placeofbirth'] = "Humptington" d1['citizenship'] = "US" d2 = IDemographics(s2) d2['ID'] = "333655" d2['ethnicity'] = u'White' d2['language'] = "Brittish" d2['placeofbirth'] = "Providence" d2['citizenship'] = "UK" course = ICourseContainer(sy)['c1'] = Course("History")
def __init__(self): self['persons'] = {} self['persons']['john'] = BasicPerson("john", "Johny", "John") self['persons']['john'].email = "*****@*****.**" self['persons']['john'].phone = "667755" self['persons']['pete'] = BasicPerson("pete", "Petey", "Pete") self['persons']['pete'].email = "*****@*****.**" self['persons']['pete'].phone = "667755"
def setUpPersons(names): app = ISchoolToolApplication(None) persons = app['persons'] for name in names: parts = name.split(' ') first = parts[0] last = ' '.join(parts[1:]) username = parts[-1].lower() persons[username] = BasicPerson(username, first, last)
def personFactory(self, namegen, count): first_name, last_name, full_name = namegen.generate() person_id = 'teacher%03d' % count person = BasicPerson(person_id, first_name, last_name) person.setPassword(person_id) return person
def populate(app): app['persons'] = BTreeContainer() app['persons']['john'] = BasicPerson("john", "Johny", "John") app['persons']['pete'] = BasicPerson("pete", "Petey", "Pete")
def __init__(self): super(AppStub, self).__init__() self['persons'] = BTreeContainer() self['persons']['john'] = BasicPerson("john", "Johny", "John") self['persons']['pete'] = BasicPerson("pete", "Petey", "Pete")