| CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Tue, 23 Dec 2025 00:55:59 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20100105134510
location: https://web.archive.org/web/20100105134510/https://github.com/hmarr/mongoengine
server-timing: captures_list;dur=1.206735, exclusion.robots;dur=0.109776, exclusion.robots.policy;dur=0.090259, esindex;dur=0.018896, cdx.remote;dur=29.454404, LoadShardBlock;dur=168.331575, PetaboxLoader3.datanode;dur=63.504659, PetaboxLoader3.resolve;dur=33.139999
x-app-server: wwwb-app241-dc8
x-ts: 302
x-tr: 266
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: wb-p-SERVER=wwwb-app241; path=/
x-location: All
x-as: 14061
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Tue, 23 Dec 2025 00:56:00 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: nginx/0.7.61
x-archive-orig-date: Tue, 05 Jan 2010 13:45:10 GMT
x-archive-orig-connection: close
x-archive-orig-status: 200 OK
x-archive-orig-etag: "eee6d0e32694c54520288569fd852dfb"
x-archive-orig-x-runtime: 90ms
x-archive-orig-content-length: 25679
x-archive-orig-cache-control: private, max-age=0, must-revalidate
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Tue, 05 Jan 2010 13:45:10 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 51_13_20100105091051_crawl103-c/51_13_20100105134431_crawl101.arc.gz
server-timing: captures_list;dur=0.554973, exclusion.robots;dur=0.025406, exclusion.robots.policy;dur=0.015559, esindex;dur=0.010204, cdx.remote;dur=10.776962, LoadShardBlock;dur=128.659070, PetaboxLoader3.datanode;dur=104.613160, PetaboxLoader3.resolve;dur=119.960762, load_resource;dur=136.995086
x-app-server: wwwb-app241-dc8
x-ts: 200
x-tr: 363
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-as: 14061
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
hmarr's mongoengine at master - GitHub
hmarr / mongoengine
- Source
- Commits
- Network (3)
- Issues (7)
- Downloads (1)
- Graphs
-
Branch:
master
-
Branches (1)
- master ✓
- Tags (1)
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Sat Dec 19 08:04:05 -0800 2009 | Added API Reference to docs [hmarr] |
| |
LICENSE | Sat Jan 02 13:34:48 -0800 2010 | Version bump to 0.1 beta [hmarr] |
| |
MANIFEST.in | Mon Jan 04 08:10:42 -0800 2010 | Added changelog to docs, updated manifest [hmarr] |
| |
README.rst | Sun Jan 03 20:34:02 -0800 2010 | Bump to v0.1.1 [hmarr] |
| |
docs/ | Mon Jan 04 08:10:42 -0800 2010 | Added changelog to docs, updated manifest [hmarr] |
| |
mongoengine/ | Mon Jan 04 16:25:42 -0800 2010 | Added Document.reload method [hmarr] |
| |
setup.py | Mon Jan 04 16:25:42 -0800 2010 | Added Document.reload method [hmarr] |
| |
tests/ | Mon Jan 04 16:25:42 -0800 2010 | Added Document.reload method [hmarr] |
README.rst
MongoEngine
| Info: | MongoEngine is an ORM-like layer on top of PyMongo. |
|---|---|
| Author: | Harry Marr (https://github.com/hmarr) |
About
MongoEngine is a Python Object-Document Mapper for working with MongoDB. Documentation available at https://hmarr.com/mongoengine/ - there is currently a tutorial, a user guide and an API reference.
Installation
If you have setuptools you can use easy_install mongoengine. Otherwise, you can download the source from GitHub and run python setup.py install.
Dependencies
- pymongo 1.1+
- sphinx (optional - for documentation generation)
Examples
Some simple examples of what MongoEngine code looks like:
class BlogPost(Document):
title = StringField(required=True, max_length=200)
posted = DateTimeField(default=datetime.datetime.now)
tags = ListField(StringField(max_length=50))
class TextPost(BlogPost):
content = StringField(required=True)
class LinkPost(BlogPost):
url = StringField(required=True)
# Create a text-based post
>>> post1 = TextPost(title='Using MongoEngine', content='See the tutorial')
>>> post1.tags = ['mongodb', 'mongoengine']
>>> post1.save()
# Create a link-based post
>>> post2 = LinkPost(title='MongoEngine Docs', url='hmarr.com/mongoengine')
>>> post2.tags = ['mongoengine', 'documentation']
>>> post2.save()
# Iterate over all posts using the BlogPost superclass
>>> for post in BlogPost.objects:
... print '===', post.title, '==='
... if isinstance(post, TextPost):
... print post.content
... elif isinstance(post, LinkPost):
... print 'Link:', post.url
... print
...
=== Using MongoEngine ===
See the tutorial
=== MongoEngine Docs ===
Link: hmarr.com/mongoengine
>>> len(BlogPost.objects)
2
>>> len(HtmlPost.objects)
1
>>> len(LinkPost.objects)
1
# Find tagged posts
>>> len(BlogPost.objects(tags='mongoengine'))
2
>>> len(BlogPost.objects(tags='mongodb'))
1
Tests
To run the test suite, ensure you are running a local instance of MongoDB on the standard port, and run python setup.py test.
Contributing
The source is available on GitHub - to contribute to the project, fork it on GitHub and send a pull request, all contributions and suggestions are welcome!
This feature is coming soon. Sit tight!
