Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
|pipeline status| |coverage report| |pypi link|
.. |pipeline status| image:: https://git.yurzs.dev/yurzs/mdocument/badges/master/pipeline.svg :target: https://git.yurzs.dev/yurzs/mdocument/-/commits/master
.. |coverage report| image:: https://git.yurzs.dev/yurzs/mdocument/badges/master/coverage.svg :target: https://git.yurzs.dev/yurzs/mdocument/-/commits/master
.. |pypi link| image:: https://badge.fury.io/py/mdocument.svg :target: https://pypi.org/project/mdocument
.. |code style| image:: https://img.shields.io/badge/code%20style-black-000000.svg :target: https://github.com/psf/black
.. |imports: isort| image:: https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336 :target: https://pycqa.github.io/isort
.. role:: strike :class: strike
MDocument is a simple ORM for MongoDB with addition of relations.
There are two ways of using mdocument:
.. code-block:: python
import asyncio
import motor.motor_asyncio
from mdocument import MDocument, relations, model
client = motor.motor_asyncio.AsyncIOMotorClient()
class Video(MDocument):
__collection__ = "videos"
__database__ = "mdocument"
__client__ = client
class Model(MDocument.Model):
title = model.Field(str)
views_count = model.Field(int)
public_id = model.Field(str, unique=True)
class Comment(MDocument):
__collection__ = "comments"
__database__ = "mdocument"
__client__ = client
class Model(MDocument.Model):
text = model.Field(str)
video = model.FieldSync(Video, relation=relations.RelationOneToMany, synced_fields=["_id", "title"])
async def main():
video = await Video.create({"title": "Test"})
comment1 = await Comment.create(
video=video._id,
message="First!",
)
comment2 = await Comment.create(
video=video._id,
message="Second!"
)
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Now we can easily access our comments using our related documents
TODO: REWRITE DOCUMENTATION!
FAQs
Simple DRM for motor client
We found that mdocument demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.