本文整理汇总了Python中north.dbutils.babel_values函数的典型用法代码示例。如果您正苦于以下问题:Python babel_values函数的具体用法?Python babel_values怎么用?Python babel_values使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了babel_values函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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)
示例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)
示例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")))
示例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"))
示例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"))
示例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()
示例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)
示例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
示例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",
)))
示例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"))
示例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)
示例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',
))
示例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)
示例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")
示例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",
))