| CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Tue, 23 Dec 2025 05:55:11 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20100414043018
location: https://web.archive.org/web/20100414043018/https://github.com/hmarr/mongoengine
server-timing: captures_list;dur=1.085380, exclusion.robots;dur=0.073921, exclusion.robots.policy;dur=0.056244, esindex;dur=0.015221, cdx.remote;dur=50.809224, LoadShardBlock;dur=578.353906, PetaboxLoader3.datanode;dur=84.339140, PetaboxLoader3.resolve;dur=48.736627
x-app-server: wwwb-app54-dc6
x-ts: 302
x-tr: 696
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=1
set-cookie: wb-p-SERVER=wwwb-app54; 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 05:55:12 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: nginx/0.7.61
x-archive-orig-date: Wed, 14 Apr 2010 04:30:18 GMT
x-archive-orig-connection: close
x-archive-orig-status: 200 OK
x-archive-orig-etag: "6db5aad5438498684abd177815131793"
x-archive-orig-x-runtime: 158ms
x-archive-orig-content-length: 27572
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: Wed, 14 Apr 2010 04:30:18 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_15_20100414041454_crawl103-c/51_15_20100414042757_crawl101.arc.gz
server-timing: captures_list;dur=0.890347, exclusion.robots;dur=0.027677, exclusion.robots.policy;dur=0.011426, esindex;dur=0.017443, cdx.remote;dur=15.857945, LoadShardBlock;dur=222.403049, PetaboxLoader3.datanode;dur=263.144188, load_resource;dur=132.541304, PetaboxLoader3.resolve;dur=52.932694
x-app-server: wwwb-app54-dc6
x-ts: 200
x-tr: 498
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 (20)
- Issues (19)
- Downloads (7)
- Graphs
-
Branch:
master
click here to add a description
click here to add a homepage
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Thu Jan 14 09:37:07 -0800 2010 | added build, dist, egg dirs to .gitignore [blackbrrr] |
| |
AUTHORS | Mon Mar 08 13:58:19 -0800 2010 | Modified AUTHORS [hmarr] |
| |
LICENSE | Sat Jan 02 13:34:48 -0800 2010 | Version bump to 0.1 beta [hmarr] |
| |
MANIFEST.in | Wed Mar 17 09:50:13 -0700 2010 | Bump to v0.3 [hmarr] |
| |
README.rst | Wed Mar 17 09:50:13 -0700 2010 | Bump to v0.3 [hmarr] |
| |
docs/ | Sun Apr 11 11:14:32 -0700 2010 | make get_or_create returns a tuple with the ret... [cyberdelia] |
| |
mongoengine/ | Mon Apr 12 09:41:09 -0700 2010 | Merge branch 'SortedListField' of git://github.... [hmarr] |
| |
setup.py | Tue Jan 05 10:17:44 -0800 2010 | Added BooleanField [hmarr] |
| |
tests/ | Mon Apr 12 09:41:09 -0700 2010 | Merge branch 'SortedListField' of git://github.... [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 -U 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.
Community
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!
