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
pymongodm
=========

pymongodm is a odm respecting pymongo functionality and adds
functionality such as model validation.

change your current orm by pymongodb.

Before:

.. figure:: http://i.imgur.com/8TTqJ9h.jpg
:alt: Imgur

Imgur
After:

.. figure:: http://i.imgur.com/NDna9Wp.jpg
:alt: Imgur

Imgur
https://pypi.python.org/pypi/pymongodm

install
-------

::

pip install pymongodm

connect db
----------

\`\`\`python import pymongodm

pymongodm.connect('name\_db') \`\`\`

or

\`\`\`python import pymongodm import pymongo

db = pymongo.MongoClient()['name\_db'] pymongodm.connect(db) \`\`\`

use db
------

\`\`\`python import pymongodm

pymongodm.connect('example\_db')

# Identical to pymongo pymongodm.db.nice\_collection.insert({'name':
'pepis'}) print(pymongodm.db.nice\_collection.find\_one()) \`\`\`

use models!
-----------

\`\`\`python import pymongodm pymongodm.connect("gstudio")

from pymongodm.models import Base

class User(Base): schema = {"name": {'type': str}, "other": {'type':
list, 'required': False}} # optional, default is class\_name + s
collection\_name = "random\_name"

::

def cut_name(self):
return self.name[:3]

insert
======

result = User({'name': 'pepito'}) print("id in db", result.\_id)

convert dict to object Model
============================

a = User({'\ *id': result.*\ id, 'name': result.name}) b =
User(result.getattrs()) # get attrs return only db attrs b =
User(result.get\_clean()) # not return except arguments (exclude\_view )

convert result finds to model
=============================

results = pymongodm.db.users.find().model(User) # or results =
User.collect.find().model(User) # or result = User(id)

for result in results: print(result.\ *id) print(result.name)
print(result.cut*\ name())

Modify values
=============

results = pymongodm.db.users.find().model(User) for result in results:
result.name = "Pymongodm\_%s" % result.name result.other = ["random",
"info"] result.update()

Remove
======

result.remove()

\`\`\`

Models options
~~~~~~~~~~~~~~

use other collection
^^^^^^^^^^^^^^^^^^^^

by default the name of the collection is the name of the class + s. It
can be changed with the following argument: collection =
"encoding\_profiles"

hidden arguments in returns
^^^^^^^^^^^^^^^^^^^^^^^^^^^

exclude\_view = ['name']

schemes allow the following parameters:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- type
- required
- function

Rewrite basic methods
---------------------

Only need declare identic name in your class

.. code:: python


class User(Base):
schema = {"name": {'type': str},
"other": {'type': list, 'required': False}}
# optional, default is class_name + s
collection_name = "random_name"

def remove(self):
print("uhm ...")

Plugins
-------

TODO ...


- 1.0.7 (03-12-2016)
- Avoid recursive validation (inspect\_recursive=False)

- 1.0.6 (10-11-2016)
- Fix .model in find method

- 1.0.5 (05-10-2016)
- Fix remove item

- 1.0.4 (29-9-2016)
- support custom\_id

- 1.0.3 (28-9-2016)
- automatic creation

1.0.2 (18-7-2016)
=================

- add method insert()

1.0.1 (12-7-2016)
=================

- remove prints

1.0.0 (12-7-2016)
=================

- auto\_get = True
- disable automatic discover cache
- if you use auto\_get = False must make a .get() to get the data in
the class
- Add support Python 2

0.1.0 (11-7-2016)
=================

- Add collect property

0.0.5 (11-7-2016)
=================

- fix require=False and value None

0.0.4 (6-6-2016)
================

- Update readme

0.0.3 (6-6-2016)
================

- Update readme
- Fix minor bugs

0.0.2 (3-6-2016)
================

- Fix pip install

0.0.1 (3-6-2016)
================

- Initial version

Release History

Release History

1.0.7

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

1.0.6

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

1.0.5

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

1.0.4

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

1.0.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

1.0.2

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

1.0.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

1.0.0

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.0

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.0.5

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.0.4

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.0.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.0.2

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.0.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
pymongodm-1.0.7.tar.gz (6.0 kB) Copy SHA256 Checksum SHA256 Source Dec 3, 2016

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