• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python dbutils.babel_values函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中north.dbutils.babel_values函数的典型用法代码示例。如果您正苦于以下问题:Python babel_values函数的具体用法?Python babel_values怎么用?Python babel_values使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了babel_values函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: objects

def objects():

    #~ yield organisationType('Firma','Firma')
    #~ yield organisationType('asbl','asbl')
    #~ yield organisationType('A.S.B.L.','A.S.B.L.')
    #~ yield organisationType('sprl','sprl')
    #~ yield organisationType('GmbH','GmbH')
    #~ yield organisationType('AG','AG')
    #~ yield organisationType('S.A.','S.A.')
    #~ yield organisationType('S.C.','S.C.')
    #~ yield organisationType('V.o.G.','V.o.G.')
    #~ yield organisationType('G.o.E.','G.o.E.')
    #~ yield organisationType('A.S.B.L.','Association sans but lucratif')
    #~ yield organisationType('Maison','Maison')
    #~ yield organisationType('Fachklinik','Fachklinik')
    #~ yield organisationType("Centre d'Accueil d'Urgence","Centre d'Accueil d'Urgence")

    #~ yield organisationType(**babel_values('name',
        #~ en=u"Public Limited Company",
        #~ nl=u'NV (Naamloze Vennootschap)',
        #~ fr=u'SA (Société Anonyme)',
        #~ de=u"AG (Aktiengesellschaft)"))

    for ct in COMPANY_TYPES:
        yield organisationType(**ct)

    yield roletype(**babel_values('name', en="Manager", fr=u'Gérant', de=u"Geschäftsführer", et=u"Manager"))
    yield roletype(**babel_values('name', en="Director", fr=u'Directeur', de=u"Direktor", et=u"Direktor"))
    yield roletype(**babel_values('name', en="Secretary", fr=u'Sécrétaire', de=u"Sekretär", et=u"Sekretär"))
    yield roletype(**babel_values('name', en="IT Manager", fr=u'Gérant informatique', de=u"EDV-Manager", et=u"IT manager"))

    I = Instantiator('system.HelpText', 'content_type field help_text').build

    Person = resolve_model("partners.Person")
    t = ContentType.objects.get_for_model(Person)
开发者ID:cuchac,项目名称:lino,代码行数:35,代码来源:std.py


示例2: C

def C(en, de, fr='', nl='', jargon=None, obsoletes=None, **kw):
    texts = dict(en=en, de=de, fr=fr, nl=nl)
    name = dict()
    abbr = dict()
    for lang in 'en', 'de', 'fr', 'nl':
        t = texts.get(lang)
        if t:
            mo = abbrRE.match(t)
            if mo:
                abbr[lang] = mo.group(1).strip()
                name[lang] = mo.group(2).strip()
            else:
                name[lang] = t
    kw.update(dbutils.babel_values('name', **name))
    kw.update(dbutils.babel_values('abbr', **abbr))
    obj = Concept(**kw)
    yield obj
    if obsoletes is not None:
        if isinstance(obsoletes, dd.Model):
            obsoletes = [obsoletes]
        for obsoleted in obsoletes:
            yield Link(parent=obsoleted, child=obj, type=LinkTypes.obsoletes)

    if jargon is not None:
        if isinstance(jargon, dd.Model):
            jargon = [jargon]
        for domain in jargon:
            yield Link(parent=domain, child=obj, type=LinkTypes.jargon)
开发者ID:ManuelWeidmann,项目名称:lino,代码行数:28,代码来源:demo.py


示例3: objects

def objects():
    ptype = Instantiator('properties.PropType').build
    
    division = ptype(**babel_values('name',**dict(en="Division",fr="Division",de=u"Abteilung")))
    yield division
    divchoice = Instantiator('properties.PropChoice','value',type=division).build
    yield divchoice('1',**babel_values('text',**dict(en="Furniture",de=u"Möbel",fr=u"Meubles")))
    yield divchoice('2',**babel_values('text',**dict(en="Web hosting",de=u"Hosting",fr=u"Hosting")))
开发者ID:MaxTyutyunnikov,项目名称:lino,代码行数:8,代码来源:demo.py


示例4: objects

def objects():
    Person = resolve_model("contacts.Person")
    Company = resolve_model("contacts.Company")
    if not isinstance(Company,UnresolvedModel):
        roletype = Instantiator('links.LinkType',
            a_type=ContentType.objects.get_for_model(Company),
            b_type=ContentType.objects.get_for_model(Person)
            ).build
        yield roletype(**babel_values('name',en="Manager",fr=u'Gérant',de=u"Geschäftsführer",et=u"Manager"))
        yield roletype(**babel_values('name',en="Director",fr=u'Directeur',de=u"Direktor",et=u"Direktor"))
        yield roletype(**babel_values('name',en="Secretary",fr=u'Sécrétaire',de=u"Sekretär",et=u"Sekretär"))
        yield roletype(**babel_values('name',en="IT Manager",fr=u'Gérant informatique',de=u"EDV-Manager",et=u"IT manager"))
开发者ID:MaxTyutyunnikov,项目名称:lino,代码行数:12,代码来源:std.py


示例5: objects

def objects():
  
    mailType = Instantiator('notes.NoteType').build
    
    yield mailType(**babel_values('name',
        en="Enrolment",
        fr=u'Inscription',de=u"Einschreibeformular"))
    yield mailType(**babel_values('name',
        en="Timetable",
        fr=u'Horaire',de=u"Stundenplan"))
    yield mailType(**babel_values('name',
        en="Letter",
        fr=u'Lettre',de=u"Brief"))
开发者ID:MaxTyutyunnikov,项目名称:lino,代码行数:13,代码来源:std.py


示例6: objects

def objects():
    
    yield sales.InvoicingMode(**babel_values('name',en='Default',de=u"Standard",fr=u"Standard"))
    
    if ledger:
        Invoice = dd.resolve_model('sales.Invoice')
        InvoiceItem = dd.resolve_model('sales.InvoiceItem')
        vt = ledger.VoucherTypes.get_for_model(Invoice)
        JOURNALS = Cycler(vt.get_journals())
        PARTNERS = Cycler(Partner.objects.all())
        USERS = Cycler(settings.SITE.user_model.objects.all())
        PRODUCTS = Cycler(products.Product.objects.all())
        ITEMCOUNT = Cycler(1,2,3)
        for i in range(20):
            jnl = JOURNALS.pop()
            invoice = Invoice(journal=jnl,
              partner=PARTNERS.pop(),
              user=USERS.pop(),
              date=settings.SITE.demo_date(-30+2*i))
            yield invoice
            for j in range(ITEMCOUNT.pop()):
                item = InvoiceItem(voucher=invoice,
                    #~ account=jnl.get_allowed_accounts()[0],
                    product=PRODUCTS.pop(),
                    )
                item.product_changed(REQUEST)
                item.before_ui_save(REQUEST)
                #~ if item.total_incl:
                    #~ print "20121208 ok", item
                #~ else:
                    #~ if item.product.price:
                        #~ raise Exception("20121208")
                yield item
            invoice.register(REQUEST)
            invoice.save()
开发者ID:MaxTyutyunnikov,项目名称:lino,代码行数:35,代码来源:demo.py


示例7: Account

 def Account(ref, type, fr, de, en, **kw):
     kw.update(babel_values('name', de=de, fr=fr, en=en))
     return accounts.Account(
         chart=chart,
         group=current_group,
         ref=ref,
         type=accounts.AccountTypes.get_by_name(type),
         **kw)
开发者ID:cuchac,项目名称:lino,代码行数:8,代码来源:mini.py


示例8: Group

 def Group(ref, type, fr, de, en):
     global current_group
     current_group = accounts.Group(
         chart=chart,
         ref=ref,
         account_type=accounts.AccountTypes.get_by_name(type),
         **babel_values('name', de=de, fr=fr, en=en))
     return current_group
开发者ID:cuchac,项目名称:lino,代码行数:8,代码来源:mini.py


示例9: objects

def objects():
    ptype = Instantiator('properties.PropType').build
    yield ptype(id=1, **babel_values('name', **dict(
        en="Present or not",
        de=u"Vorhanden oder nicht",
        fr=u"Présent ou pas",
        et=u"Olemas või mitte",
        nl=u"Ja of niet",
    )))
    yield ptype(id=2,
                choicelist=properties.HowWell.actor_id,
                default_value=properties.HowWell.default.value,
                **babel_values('name', **dict(
                    en="Rating",
                    de=u"Bewertung",
                    et=u"Hinnang",
                    fr=u"Appréciation(?)",
                    nl=u"Hoe goed",
                )))
开发者ID:cuchac,项目名称:lino,代码行数:19,代码来源:std.py


示例10: objects

def objects():
    if False and notes:
        NoteType = dd.resolve_model('notes.NoteType')
        yield NoteType(
            template="Letter.odt",
            build_method="appyodt",
            body_template="payment_reminder.body.html",
            **babel_values('name',
                           en="Payment reminder",
                           fr="Rappel de paiement",
                           de="Zahlungserinnerung"))
开发者ID:ManuelWeidmann,项目名称:lino,代码行数:11,代码来源:std.py


示例11: objects

def objects():
    n = 0
    for code, kw in LANGUAGES.items():
        iso2 = kw['iso2']
        kw = babel_values('name', **kw)
        if kw.get('name'):
            n += 1
            kw.update(iso2=iso2)
            yield Language(id=code, **kw)
        else:
            logger.debug("%r : no name for default site language %s",
                         code, settings.SITE.DEFAULT_LANGUAGE.django_code)
开发者ID:cuchac,项目名称:lino,代码行数:12,代码来源:all_languages.py


示例12: objects

def objects():

    Language = Instantiator('languages.Language', "id").build

    yield Language('ger', **babel_values('name',
                                         de=u"Deutsch",
                                         fr=u'Allemand',
                                         en=u'German',
                                         nl=u'Duits',
                                         et=u'Saksa',
                                         ))
    yield Language('fre', **babel_values('name',
                                         de=u"Französisch",
                                         fr=u'Français',
                                         en=u'French',
                                         nl=u'Frans',
                                         et=u'Prantsuse',
                                         ))
    yield Language('eng', **babel_values('name',
                                         de=u"Englisch",
                                         fr=u'Anglais',
                                         en=u'English',
                                         nl=u'Engels',
                                         et=u'Inglise',
                                         ))
    yield Language('dut', **babel_values('name',
                                         de=u"Niederländisch",
                                         fr=u'Néerlandais',
                                         en=u'Dutch',
                                         nl=u'Nederlands',
                                         et=u'Hollandi',
                                         ))
    yield Language('est', **babel_values('name',
                                         de=u"Estnisch",
                                         fr=u'Estonien',
                                         en=u'Estonian',
                                         et=u'Eesti',
                                         ))
开发者ID:cuchac,项目名称:lino,代码行数:38,代码来源:few_languages.py


示例13: objects

def objects():

    n = 0
    Country = settings.SITE.modules.countries.Country
    """
    
    """
    fn = os.path.join(os.path.dirname(__file__), 'countries.xml')
    logger.debug("Reading %s", fn)
    dom = minidom.parse(fn)
    #~ print dom.documentElement.__class__
    #~ print dom.documentElement
    for coun in dom.documentElement.getElementsByTagName('coun:country'):
        names = {}
        for name in coun.getElementsByTagName('coun:name'):
            assert len(name.childNodes) == 1
            #~ print [n.data for n in ]
            #~ print name.firstChild.data
            names[str(name.attributes['lang'].value)] = name.firstChild.data

        kw = babel_values('name', **names)
        iso2 = coun.getElementsByTagName('coun:alpha2')[0].childNodes[0].data
        if Country.objects.filter(pk=iso2).count() > 0:
            logger.debug("ISO code %r already exists %s", iso2, coun)
            continue
        kw.update(
            isocode=iso2,
            iso3=coun.getElementsByTagName(
                'coun:alpha3')[0].childNodes[0].data,
        )

        if not 'name' in kw:
            kw['name'] = names['en']
        if kw['name']:
            #~ kw.update(iso3=iso3)
            n += 1
            yield Country(**kw)
        else:
            logger.warning(
                "%r : no name for default site language %s",
                coun, settings.SITE.DEFAULT_LANGUAGE.django_code)

    for ln in TABLE2.splitlines():
        ln = ln.strip()
        if ln:
            code1, code2, code3, name = ln.split(None, 3)
            n += 1
            yield Country(isocode=code1, name=name)

    logger.info("Installed %d countries", n)
开发者ID:raffas,项目名称:lino,代码行数:50,代码来源:all_countries.py


示例14: objects

def objects():

    productcat = Instantiator('products.ProductCat').build
    product = Instantiator('products.Product', "cat name").build

    food = productcat(**babel_values(
        'name',
        en="Food", et="Toit", de="Lebensmittel", fr="Alimentaire"))
    yield food
    yield product(food, "Le petit Fagnard", **babel_values(
        'description',
        en="Handmade cheese from Hautes Ardennes",
        et="Käsitsi valmistatud juust Ardenne'idest",
        de="Handgemachter Käse aus den Hohen Ardennen",
        fr="Fromage artisanal au lait cru des Hautes Ardennes"))

    if False:  # we need an address parser which either returns or
               # creates the city. Here we don't want to know whether
               # `countries.fixtures.be` has been loaded.
        company = Instantiator(
            'contacts.Company',
            "name country:isocode city:zip_code").build
        yield company("Fromagerie du Troufleur", "BE", "4950 Waimes")
开发者ID:raffas,项目名称:lino,代码行数:23,代码来源:food.py


示例15: objects

def objects():
    
    if False:

        guest_role = Instantiator('cal.GuestRole').build
        yield guest_role(**babel_values('name',
              de=u"Teilnehmer",
              fr=u"Participant",
              en=u"Participant",
              et=u"Osavõtja",
              ))
        yield guest_role(**babel_values('name',
              de=u"Reiseführer",
              fr=u"Guide",
              en=u"Guide",
              et=u"Reisijuht",
              ))
        yield guest_role(**babel_values('name',
              de=u"Vorsitzender",
              fr=u"Président",
              en=u"Presider",
              et=u"Eesistuja",
              ))
        yield guest_role(**babel_values('name',
              de=u"Protokollführer",
              fr=u"Greffier",
              en=u"Reporter",
              et=u"Sekretär",
              ))
              
          
    if False:
    
        place = Instantiator('cal.Room').build
        yield place(**babel_values('name',
              de=u"Büro",
              fr=u"Bureau",
              en=u"Office",
              ))
        yield place(**babel_values('name',
              de=u"Beim Klienten",
              fr=u"Chez le client",
              en=u"A the client's",
              ))
        yield place(**babel_values('name',
              de=u"beim Arbeitgeber",
              fr=u"chez l'employeur",
              en=u"at employer's",
              ))
开发者ID:MaxTyutyunnikov,项目名称:lino,代码行数:49,代码来源:demo.py


示例16: objects

def objects():
            
    n = 0
    """
    
    """
    fn = os.path.join(os.path.dirname(__file__),'countries.xml')
    dom = minidom.parse(fn)
    #~ print dom.documentElement.__class__
    #~ print dom.documentElement
    for coun in dom.documentElement.getElementsByTagName('coun:country'):
        #~ print coun.toxml()
        #~ print c.attributes['coun:alpha2']
        names = {}
        for name in coun.getElementsByTagName('coun:name'):
            assert len(name.childNodes) == 1
            #~ print [n.data for n in ]
            #~ print name.firstChild.data
            names[str(name.attributes['lang'].value)] = name.firstChild.data
            
        kw = babel_values('name',**names)
        kw.update(
          isocode = coun.getElementsByTagName('coun:alpha2')[0].childNodes[0].data,
          iso3 = coun.getElementsByTagName('coun:alpha3')[0].childNodes[0].data,
          )
        
        if kw['name']:
            #~ kw.update(iso3=iso3)
            n += 1
            yield Country(**kw)
        else:
            logger.debug("%r : no name for default site language %s",
                code,settings.SITE.DEFAULT_LANGUAGE.django_code)
            
    for ln in TABLE2.splitlines():
        ln = ln.strip()
        if ln:
            code1, code2, code3, name = ln.split(None,3)
            n += 1
            yield Country(isocode=code1,name=name)
开发者ID:MaxTyutyunnikov,项目名称:lino,代码行数:40,代码来源:all_countries.py


示例17: objects

def objects():
    countries = dd.resolve_app('countries')
    city = Instantiator(countries.Place, "zip_code name",
                        country='BE',
                        type=countries.PlaceTypes.city).build
    for ln in belgian_cities.splitlines():
        ln = ln.strip()
        if ln and ln[0] != '#':
            args = ln.split(None, 1)
            o = city(*args)
            # print "%r %r" % (o.zip_code, o.name)
            yield o
            #~ print __name__, "20121114"
            #~ return
    for ln in belgian_cities_nl_fr.splitlines():
        ln = ln.strip()
        if ln and ln[0] != '#':
            args = ln.split('|')
            if len(args) != 4:
                raise Exception("Invalid format : \n%s" % ln)
            args = [x.strip() for x in args]
            o = city(zip_code=args[0], **babel_values('name',
                     nl=args[1], fr=args[2], de=args[3], en=args[3]))
            yield o
开发者ID:ManuelWeidmann,项目名称:lino,代码行数:24,代码来源:be.py


示例18: objects

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="very urgent", de="sehr dringend", fr="très urgent"))
    yield add("2", **babel_values("name", en="quite urgent", de="recht dringend", fr="relativement urgent"))
    yield add("3", **babel_values("name", en="relatively urgent", de="ziemlich dringend", fr="relativement urgent"))
    yield add("4", **babel_values("name", en="relatively urgent", de="ziemlich dringend", fr="relativement urgent"))
    yield add("5", **babel_values("name", en="normal", de="normal", fr="normal"))
    yield add("6", **babel_values("name", en="not very urgent", de="nicht sehr niedrig", fr="pas très urgent"))
    yield add("7", **babel_values("name", en="not urgent", de="nicht dringend", fr="pas urgent"))
    yield add("8", **babel_values("name", en="not urgent", de="nicht dringend", fr="pas urgent"))
    yield add(
        "9", **babel_values("name", en="not urgent at all", de="überhaupt nicht dringend", fr="pas urgent du tout")
    )

    calendar = Instantiator("cal.Calendar").build
    general = calendar(**dd.babelkw("name", de="Allgemein", fr="Général", en="General"))
    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.babelkw("name", de="Feiertage", fr="Jours fériés", en="Holidays"))
    yield holidays

    RecurrentEvent = dd.resolve_model("cal.RecurrentEvent")
    add = Instantiator(RecurrentEvent, event_type=holidays).build

    def holiday(month, day, en, de, fr):
        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)
        )

    yield holiday(1, 1, "New Year's Day", "Neujahr", "Jour de l'an")
    yield holiday(5, 1, "International Workers' Day", "Tag der Arbeit", "Premier Mai")
    yield holiday(7, 21, "National Day", "Nationalfeiertag", "Fête nationale")
    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")

    summer = holiday(07, 01, "Summer holidays", "Sommerferien", "Vacances d'été")
    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)
开发者ID:raffas,项目名称:lino,代码行数:77,代码来源:std.py


示例19: be_city

 def be_city(zip_code, de=None, fr=None, nl=None, en=None, **kw):
     kw.update(babel_values('name', de=de, fr=fr, nl=nl, en=en))
     kw.setdefault('type', PlaceTypes.city)
     return Place(country=BE, zip_code=zip_code, **kw)
开发者ID:raffas,项目名称:lino,代码行数:4,代码来源:few_cities.py


示例20: be_province

 def be_province(de, fr, nl):
     return Place(country=BE, type=PlaceTypes.province,
                 **babel_values('name', de=de, fr=fr, nl=nl, en=fr))
开发者ID:raffas,项目名称:lino,代码行数:3,代码来源:few_cities.py



注:本文中的north.dbutils.babel_values函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python nose.case函数代码示例发布时间:2022-05-27
下一篇:
Python tests.RecipeFactory类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap