def objects(): Language = Instantiator('languages.Language', "id").build yield Language('ger', **dd.str2kw('name', _("German"))) yield Language('fre', **dd.str2kw('name', _("French"))) yield Language('eng', **dd.str2kw('name', _("English"))) yield Language('dut', **dd.str2kw('name', _("Dutch"))) yield Language('est', **dd.str2kw('name', _("Estonian")))
def objects(): ExcerptType = dd.resolve_model('excerpts.ExcerptType') for cls in dd.models_by_base(Certifiable): kw = dd.str2kw(cls._meta.verbose_name, 'name') if False: kw.update(backward_compat=True) yield ExcerptType( template='Default.odt', primary=True, certifying=True, content_type=ContentType.objects.get_for_model(cls), **kw)
def objects(): def country(isocode, **kw): try: return Country.objects.get(isocode=isocode) except Country.DoesNotExist: return Country(isocode=isocode, **kw) yield country('EE', **dd.str2kw(_("Estonia"), 'name')) yield country('BE', **dd.str2kw(_("Belgium"), 'name')) yield country('DE', **dd.str2kw(_("Germany"), 'name')) yield country('FR', **dd.str2kw(_("France"), 'name')) yield country('NL', **dd.str2kw(_("Netherlands"), 'name')) yield country('MA', **dd.str2kw(_("Maroc"), 'name')) yield country('RU', **dd.str2kw(_("Russia"), 'name')) yield country('CD', **dd.str2kw(_("Congo (Democratic Republic)"), 'name'))
def objects(): Type = rt.modules.households.Type yield Type(**dd.str2kw('name', _("Married"))) # Verheiratet / Marié yield Type(**dd.str2kw('name', _("Divorced"))) # Geschieden / Divorcé yield Type(**dd.str2kw('name', _("Factual household"))) # Faktischer Haushalt / Ménage de fait yield Type(**dd.str2kw('name', _("Legal cohabitation"))) # Legale Wohngemeinschaft / Cohabitation légale yield Type(**dd.str2kw('name', _("Isolated"))) yield Type(**dd.str2kw('name', _("Other")))
def objects(): ListType = rt.modules.lists.ListType List = rt.modules.lists.List mailing = ListType(**dd.str2kw('name', _("Mailing list"))) yield mailing discuss = ListType(**dd.str2kw('name', _("Discussion group"))) yield discuss flags = ListType(**dd.str2kw('name', _("Flags"))) yield flags yield List(list_type=mailing, **dd.str2kw('name', _("Announcements"))) yield List(list_type=mailing, **dd.str2kw('name', _("Weekly newsletter"))) yield List(list_type=discuss, **dd.str2kw('name', _("General discussion"))) yield List(list_type=discuss, **dd.str2kw('name', _("Beginners forum"))) yield List(list_type=discuss, **dd.str2kw('name', _("Developers forum"))) yield List(list_type=flags, **dd.str2kw('name', _("PyCon 2014"))) yield List(list_type=flags, **dd.str2kw('name', _("Free Software Day 2014"))) yield List(list_type=flags, **dd.str2kw('name', _("Schools")))
def objects(): Person = dd.resolve_model(dd.apps.humanlinks.person_model) Link = rt.modules.humanlinks.Link LinkTypes = rt.modules.humanlinks.LinkTypes ar = rt.login() households = dd.resolve_app('households') if households: married = households.Type.objects.get( **dd.str2kw('name', _("Married"))) divorced = households.Type.objects.get( **dd.str2kw('name', _("Divorced"))) ig = InstanceGenerator() ig.add_instantiator( 'person', Person, 'first_name last_name gender birth_date') ig.add_instantiator( 'link', Link, 'parent child type') NAME1 = "Frisch" opa = ig.person("Hubert", NAME1, 'M', '1933-07-21') oma = ig.person("Gaby", "Frogemuth", 'F', '1934-08-04') P = ig.person("Paul", NAME1, 'M', '1967-06-19') L = ig.person("Ludwig", NAME1, 'M', '1968-06-01') A = ig.person("Alice", NAME1, 'F', '1969-12-19') B = ig.person("Bernd", NAME1, 'M', '1971-09-10') P1 = ig.person("Paula", "Einzig", 'F', '1968-12-19') P1A = ig.person("Peter", NAME1, 'M', '1987-06-19') P2 = ig.person("Petra", "Zweith", 'F', '1968-12-19') P2A = ig.person("Philippe", NAME1, 'M', '1997-06-19') P2B = ig.person("Clara", NAME1, 'F', '1999-06-19') P3 = ig.person("Dora", "Drosson", 'F', '1971-12-19') P3A = ig.person("Dennis", NAME1, 'M', '2001-06-19') L1 = ig.person("Laura", "Loslever", 'F', '1968-04-27') L1A = ig.person("Melba", NAME1, 'F', '2002-04-05') L1B = ig.person("Irma", NAME1, 'F', '2008-03-24') yield ig.flush() ig.link(opa, oma, LinkTypes.spouse) for i in (P, L, A, B): ig.link(opa, i, LinkTypes.parent) ig.link(oma, i, LinkTypes.parent) ig.link(P, P1A, LinkTypes.parent) ig.link(P1, P1A, LinkTypes.parent) ig.link(P, P2A, LinkTypes.parent) ig.link(P2, P2A, LinkTypes.parent) ig.link(P, P2B, LinkTypes.parent) ig.link(P2, P2B, LinkTypes.parent) ig.link(P, P3A, LinkTypes.parent) ig.link(P3, P3A, LinkTypes.parent) ig.link(P, P2, LinkTypes.spouse) ig.link(L, L1, LinkTypes.spouse) for i in (L1A, L1B): ig.link(L, i, LinkTypes.parent) ig.link(L1, i, LinkTypes.parent) yield ig.flush() if households: households.Household.create_household(ar, opa, oma, married) households.Household.create_household(ar, P, P1, divorced) hh = households.Household.create_household(ar, P, P2, married) hh.members_by_role('head')[0].set_primary(ar) hh.members_by_role('partner')[0].set_primary(ar) households.Household.create_household(ar, L, L1, married) A = ig.person("Albert", "Adam", 'M', '1973-07-21') B = ig.person("Bruno", "Braun", 'M', '1973-07-22') E = ig.person("Eveline", "Evrard", 'F', '1974-08-21') F = ig.person("Françoise", "Freisen", 'F', '1974-08-22') I = ig.person("Ilja", "Adam", 'M', '1994-08-22') J = ig.person("Jan", "Braun", 'M', '1996-08-22') K = ig.person("Kevin", "Braun", 'M', '1998-08-22') L = ig.person("Lars", "Braun", 'M', '1998-08-22') M = ig.person("Monique", "Braun", 'F', '2000-08-22') N = ig.person("Noémie", "Adam", 'F', '2002-08-22') O = ig.person("Odette", "Adam", 'F', '2004-08-22') P = ig.person("Pascale", "Adam", 'F', '2004-08-22') yield ig.flush() ig.link(A, I, LinkTypes.parent) ig.link(A, N, LinkTypes.parent) ig.link(A, O, LinkTypes.parent) ig.link(A, P, LinkTypes.parent) ig.link(B, J, LinkTypes.parent) ig.link(B, K, LinkTypes.parent) ig.link(B, L, LinkTypes.parent) ig.link(B, M, LinkTypes.parent) ig.link(E, I, LinkTypes.parent) ig.link(E, J, LinkTypes.parent) ig.link(E, K, LinkTypes.parent) ig.link(E, L, LinkTypes.parent) ig.link(F, M, LinkTypes.parent) ig.link(F, N, LinkTypes.parent) ig.link(F, O, LinkTypes.parent) ig.link(F, P, LinkTypes.parent) ig.link(A, F, LinkTypes.spouse) ig.link(B, E, LinkTypes.spouse) yield ig.flush() if households: households.Household.create_household(ar, A, E, married) households.Household.create_household(ar, A, F, divorced) households.Household.create_household(ar, B, E, divorced) households.Household.create_household(ar, B, F, married)
def objects(): #~ add = Instantiator('cal.EventStatus','ref').build #~ yield add('0',**babel_values('name',en=u"tentative",de=u"Vorschlag", fr=u"proposition")) #~ yield add('1',**babel_values('name',en=u"confirmed",de=u"bestätigt", fr=u"confirmé")) #~ yield add('2',**babel_values('name',en=u"cancelled",de=u"storniert", fr=u"annulé")) #~ yield add('3',**babel_values('name',en=u"rescheduled",de=u"verschoben", fr=u"reporté")) #~ yield add('4',**babel_values('name',en=u"absent",de=u"abwesend", fr=u"absent")) #~ add = Instantiator('cal.TaskStatus','ref').build #~ yield add('0',**babel_values('name',en=u"needs action",de=u"zu erledigen", fr=u"à traîter")) #~ yield add('1',**babel_values('name',en=u"in process",de=u"begonnen", fr=u"commencée")) #~ yield add('2',**babel_values('name',en=u"completed",de=u"erledigt", fr=u"complétée")) #~ yield add('3',**babel_values('name',en=u"cancelled",de=u"storniert", fr=u"annulée")) #~ add = Instantiator('cal.AccessClass','ref').build #~ yield add('0',**babel_values('name',en=u"Public",de=u"Öffentlich", fr=u"Public")) #~ yield add('1',**babel_values('name',en=u"Private",de=u"Privat", fr=u"Privé")) #~ yield add('2',**babel_values('name',en=u"Confidential",de=u"Vertraulich", fr=u"Confidentiel")) add = Instantiator('cal.Priority', 'ref').build yield add('1', **babel_values('name', en=u"very urgent", de=u"sehr dringend", fr=u"très urgent", et=u"väga kiire")) # yield add('2', **babel_values('name', en=u"quite urgent", de=u"recht dringend", fr=u"relativement urgent")) yield add('3', **babel_values('name', en=u"urgent", de=u"dringend", fr=u"urgent", et="kiire")) # yield add('4', **babel_values('name', en=u"relatively urgent", de=u"ziemlich dringend", fr=u"relativement urgent")) yield add('5', **babel_values('name', en=u"normal", de=u"normal", fr=u"normal", et="keskmine")) # yield add('6', **babel_values('name', en=u"not very urgent", de=u"nicht sehr niedrig", fr=u"pas très urgent")) # yield add('7', **babel_values('name', en=u"not urgent", de=u"nicht dringend", fr=u"pas urgent")) yield add('9', **babel_values('name', en=u"not urgent", de=u"nicht dringend", fr=u"pas urgent", et="mitte kiire")) # yield add('9', **babel_values('name', en=u"not urgent at all", de=u"überhaupt nicht dringend", fr=u"pas urgent du tout")) calendar = Instantiator('cal.Calendar').build general = calendar(**dd.str2kw('name', _("General"))) # de="Allgemein", # fr="Général", yield general settings.SITE.site_config.site_calendar = general #~ settings.SITE.site_config.holiday_event_type = holidays yield settings.SITE.site_config event_type = Instantiator('cal.EventType').build holidays = event_type(all_rooms=True, **dd.str2kw('name', _("Holidays"))) # de="Feiertage", # fr="Jours fériés", yield holidays RecurrentEvent = dd.resolve_model('cal.RecurrentEvent') add = Instantiator(RecurrentEvent, event_type=holidays).build def holiday(month, day, en, de, fr, et=None): if et is None: et = en return add( every_unit=cal.Recurrencies.yearly, monday=True, tuesday=True, wednesday=True, thursday=True, friday=True, saturday=True, sunday=True, every=1, start_date=datetime.date( year=cal.DEMO_START_YEAR, month=month, day=day), **dd.babelkw('name', en=en, de=de, fr=fr, et=et)) yield holiday(1, 1, "New Year's Day", "Neujahr", "Jour de l'an", "Uusaasta") yield holiday(5, 1, "International Workers' Day", "Tag der Arbeit", "Premier Mai", "kevadpüha") yield holiday(7, 21, "National Day", "Nationalfeiertag", "Fête nationale", "Belgia riigipüha") yield holiday(8, 15, "Assumption of Mary", "Mariä Himmelfahrt", "Assomption de Marie") yield holiday(10, 31, "All Souls' Day", "Allerseelen", "Commémoration des fidèles défunts") yield holiday(11, 1, "All Saints' Day", "Allerheiligen", "Toussaint") yield holiday(11, 11, "Armistice with Germany", "Waffenstillstand", "Armistice") yield holiday(12, 25, "Christmas", "Weihnachten", "Noël", "Esimene Jõulupüha") summer = holiday(07, 01, "Summer holidays", "Sommerferien", "Vacances d'été", "Suvevaheaeg") summer.end_date = summer.start_date.replace(month=8, day=31) yield summer ar = settings.SITE.login() for obj in RecurrentEvent.objects.all(): if not obj.update_reminders(ar): raise Exception("Oops, %s generated no events" % obj)
def objects(): polls = rt.modules.polls name = dd.str2kw('name', _("Acquired"))['name'] acquired = polls.ChoiceSet.objects.get(name=name) USERS = Cycler(settings.SITE.user_model.objects.all()) def poll(choiceset, title, details, questions): obj = polls.Poll( user=USERS.pop(), title=title.strip(), details=details.strip(), state=polls.PollStates.published, questions_to_add=questions, default_choiceset=choiceset) obj.full_clean() obj.save() obj.after_ui_save(None) return obj yield poll( acquired, "Pour commencer ma recherche d'emploi, je dois", """ Veuillez sélectionner votre réponse pour chaque question """, """ Avoir une farde de recherche d’emploi organisée Réaliser mon curriculum vitae Savoir faire une lettre de motivation adaptée au poste de travail visé Respecter les modalités de candidature Me créer une boite e-mail appropriée à la recherche d’emploi Créer mon compte sur le site de Forem Mettre mon curriculum vitae sur le site du Forem Connaître les aides à l’embauche qui me concernent Etre préparé à l’entretien d’embauche ou téléphonique """) yield poll( acquired, "Est-ce que je sais...", """ Veuillez sélectionner votre réponse pour chaque question """, """ Utiliser le site du Forem pour consulter les offres d’emploi Décoder une offre d’emploi Adapter mon curriculum vitae par rapport à une offre ou pour une candidature spontanée Réaliser une lettre de motivation suite à une offre d’emploi Adapter une lettre de motivation par rapport à l’offre d’emploi Réaliser une lettre de motivation spontanée Utiliser le fax pour envoyer mes candidatures Utiliser ma boite e-mail pour envoyer mes candidatures Mettre mon curriculum vitae en ligne sur des sites d’entreprise Compléter en ligne les formulaires de candidature M’inscrire aux agences intérim via Internet M’inscrire auprès d’agence de recrutement via Internet Utiliser Internet pour faire des recherches sur une entreprise Préparer un entretien d’embauche (questions, argumentation du C.V.,…) Utiliser Internet pour gérer ma mobilité (transport en commun ou itinéraire voiture) Utiliser la photocopieuse (ex : copie de lettre de motivation que j’envoie par courrier) Utiliser le téléphone pour poser ma candidature Utiliser le téléphone pour relancer ma candidature "Trouver et imprimer les formulaires de demandes d’aides à l’embauche se trouvant sur le site de l’ONEm" """)