MultiLingualField for MongoEngine (for Python 2k and 3k)
Simple extension for MongoEngine, which adds MultiLingualField (based on MultiLingualString). Some self-describing examples:
from locale import setlocale, LC_ALL
from mongoengine import Document, connect
from mongoengine_mls import MultiLingualField
class Country(Document):
meta = {"indexes": ["name.language"]}
name = MultiLingualField(required=True)
setlocale(LC_ALL, "en_US.UTF-8")
connect("test")
ru = Country(name={"en": "Russia", "ru": u"Россия"})
ru.save()
print(ru.name) # => Russia
print(ru.name >> "ru") # => Россия
ru2 = Country.objects.first()
ru2.name = [
{"language": "en", "value": "Russian Federation"},
{"language": "ru", "value": u"Российская Федерация"}
]
ru2.save()
print(ru2.name) # => Russia Federation
print(type(ru2.name)) # => <class 'mls.MultiLingualString'>
Metadata
Release files for mongoengine-mls 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mongoengine-mls-1.1.0.tar.gz | 3.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mongoengine_mls-1.1.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 8.2 kB
Release files / mongoengine-mls-1.1.0.tar.gz
| Download URL | mongoengine-mls-1.1.0.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
689c8a2a083ed5999faec6829dc2d15f01c0b13e4a71b758cef8d14b641d82dd
|
|
BLAKE2b-256 checksum How to use checksums |
e72ed736e1f38ab7f5448e546ca4b33638705de9c9952a68894cf2522e12f953
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / mongoengine_mls-1.1.0-py2.py3-none-any.whl
| Download URL | mongoengine_mls-1.1.0-py2.py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
d1a768967995d36376bbb9103706903642fdf5c06c1e2c1f680243c79b0e2e7d
|
|
BLAKE2b-256 checksum How to use checksums |
bd5e80350ec0feaa89d7082830ade3b94fd8467b43d827f54af86f0b16858304
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for mongoengine-mls 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.