This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Documentation: #TODO

Ognom is object-to-document mapper for mongodb. Currently ognom uses pymongo as default backend, but you can easily implement your own backend based on another driver (for example asyncio-mongo) if needed, as serialization and storage logic in ognom are separated.

Supports python2.7+, python3.3+, PyPy.

Documentation: #TODO

Install

pip install ognom

Tests

tox

Features

  • Vanilla python, no dependencies;
  • From version 1.0 exposes full pymongo API(!);
  • Easy to write your own backend with your own API.

Quickstart

from ognom.base import ConnectionManager, Document, Collection
from ognom.fields import StringField, IntField

ConnectionManager.connect({
    'main': {  # ognom use aliases for databases to make it possible to use multiple db's per project
        'name': 'birzha_main',
        'args': ['127.0.0.1:27017'],
        'kwargs': {'socketTimeoutMS': 60000}},})


class Foo(Document):
    objects = Collection(
        db_name='main'
        collection_name='my_foos'  # collection name (by default 'foos')
        indexes=[{
            'index': [('bar', 1), ('baz', -1)],
            'background': True}])

    bar = StringField(required=True, default='baaar')
    baz = IntField(choices=[10, 20, 30, 40, 50])


foo1 = Foo.objects.create({'bar': 'lalala'})
assert Foo.objects.get({'bar': 'lalala'}).id == foo1.id

foo2 = Foo(bar='lololo', baz=10)
assert foo2.id is None
foo2.save()
assert foo2.id is not None
foo2.remove()

foos = Foo.objects.find({'bar': 'lalala'})  # not list but CursorWrapper!
assert len(list(foos)) == 1

Contributors

Release History

Release History

0.5.4

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.5.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.5.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.4.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
ognom-0.5.4.tar.gz (16.2 kB) Copy SHA256 Checksum SHA256 Source Oct 5, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting