{ "info": { "author": "Peter Bengtsson", "author_email": "mail@peterbe.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Utilities" ], "description": "django-mongokit\n===============\n\nBy: Peter Bengtsson, mail@peterbe.com, 2010-2011\n\nLicense: New BSD License\n\nBridging Django to MongoDB with the MongoKit ODM\n------------------------------------------------\n\nThe purpose of this module is to make it easy to use\n[MongoKit](http://bitbucket.org/namlook/mongokit/wiki/Home) to\ndefine your models for Django if you prefer to use MongoDB instead of\na relational database. This kit takes care of the boilerplate and\nmakes your MongoKit documents work better with Django as it defines a\n`_meta` class attribute when registering.\n\nInstallation\n------------\n\n`pip install django-mongokit`\n\nUsage/Configuration\n-------------------\n\nFirst of all you need to define a name of the database and but that\ninto your `settings.DATABASES` directive. Here's an example:\n\n DATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.sqlite3',\n 'NAME': 'example-sqlite3.db',\n },\n 'mongodb': {\n 'ENGINE': 'django_mongokit.mongodb',\n 'NAME': 'example',\n },\n }\n\nNote that `default` and `mongodb` are mandatory keys in this settings.\nWhat you can change is the `NAME` part under `DATABASES['mongodb']`.\n\nIn Django, you might be used to doing something like this:\n\n from django.db import models\n\n class Talk(models.Model):\n topic = models.CharField(max_length=250)\n date = models.DateTimeField()\n\nNow, with `django_mongokit` you can do this:\n\n from django_mongokit.document import DjangoDocument\n\n class Talk(DjangoDocument):\n structure = {\n\t 'topic': unicode,\n\t 'date': datetime.datetime\n\t}\n\nThis base class gives you some benefits out-of-the-box which will\nhopefully make working with MongoKit documents easier such as `pk`.\nThis will return the `ObjectID` of an instance as a byte string which\ncan be very useful for mapping URLs and finding documents by ID. For\nexample:\n\n >>> from mongokit import Connection\n >>> conn = Connection()\n >>> from exampleapp.models import Talk\n >>> conn.register([Talk])\n >>> database = conn['example']\n >>> collection = database['talks']\n >>> talk = collection.Talk.find_one()\n >>> talk\n '4b87c6b19d40b3375a000001'\n\nThere's also the `_meta` attribute which Django people will be\nfamiliar with:\n\n >>> talk._meta\n \n >>> talk._meta.verbose_name\n 'Talk'\n >>> talk._meta.verbose_name_plural\n 'Talks'\n\nIf you want to override any of the `_meta` attributes you do it just\nlike you do it with the Django ORM:\n\n\n class Talk(models.Model):\n ...\n class Meta:\n verbose_name_plural = u\"Talkings\"\n\nA limited set of signals are fired when working with `django_mongokit`\ndocuments. These are:\n\n* ``pre_delete``\n* ``post_delete``\n* ``pre_save``\n* ``post_save``\n\n\nExamples\n--------\n\n`django-mongokit` comes with an example project and an example app\nthat does some basic things. It might be a good source of inspiration\nfor how to use `django-mongokit` to look at this example app.\n\n\nDjango 1.1 (pre multi-db support)\n---------------------------------\n\n`django-mongokit` was built for Django 1.2 with the multi-db support\nbut you can use `django-mongokit` in Django 1.1 (tested in Django\n1.1.1) as a secondary database. For example, you might want to\ncontinue running your application in MySQL/PosgreSQL/Oracle as it is\nbut you then have a fast logging app that writes to MongoDB. The way\ndifference from using Django 1.2 is to that you need to specify a\nsetting called `MONGO_DATABASE_NAME` like this:\n\n MONGO_DATABASE_NAME = \"example\"\n\nDocument Forms\n--------------\n\nA version of Django's ModelForm has been supplied for Mongokit Documents, called DocumentForm.\n\nUsing it is as simple as:\n\n from django_mongokit.forms import DocumentForm\n from models import Talk\n\n class TalkForm(DocumentForm):\n\n class Meta:\n document = Talk\n\nThis automatically pulls the fields from mongokit's `structure` attribute, along with associated `required_fields` and `default_values`, and builds associated form fields for this document.\n\nYou can customize the `DocumentForm` just like you'd customize a `ModelForm`:\n\n class TalkForm(DocumentForm):\n\n def clean_when(self):\n \"\"\"\n Take a date object from the DateField and create a\n datetime object.\n \"\"\"\n w = self.cleaned_data['when']\n when = datetime.datetime(w.year, w.month, w.day, 0,0,0)\n return when\n\n class Meta:\n document = Talk\n fields = ['topic', 'tags']\n # You could also explicitly exclude fields\n # exclude = ['created_on']\n\nRight now, DocumentForms support the following mongokit datatypes: `int`, `bool`, `float`, `unicode`, `datetime.datetime`, `datetime.date`, `datetime.time`, `list` and `dict` (`list` and `dict` show up as character fields editable in JSON format). DocumentForms do not support nested documents or nested dictionary keys at the moment.\n\nDocumentForms do not at the moment support mongokit validations.\n\n\nTroubleshooting\n---------------\n\nIf you get this error:\n\n django.core.exceptions.ImproperlyConfigured:\n 'django_mongokit.mongodb' isn't an available database backend. \n Try using django.db.backends.XXX, where XXX is one of:\n 'dummy', 'mysql', 'oracle', 'postgresql', 'postgresql_psycopg2',\n 'sqlite3'\n Error was: No module named mongokit\n \nThen it's simply because you don't have ``mongokit`` itself installed.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/peterbe/django-mongokit", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "django-mongokit", "package_url": "https://pypi.org/project/django-mongokit/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-mongokit/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/peterbe/django-mongokit" }, "release_url": "https://pypi.org/project/django-mongokit/0.2.6/", "requires_dist": null, "requires_python": null, "summary": "Bridging Django to MongoDB with the MongoKit ODM", "version": "0.2.6" }, "last_serial": 851350, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "12dbd58fff68f82b65a5ec66702f1067", "sha256": "725c85a8e65a24e9436a1589de8dad9208906e4a2b343a9f7aac088aefdceacf" }, "downloads": -1, "filename": "django-mongokit-0.1.tar.gz", "has_sig": false, "md5_digest": "12dbd58fff68f82b65a5ec66702f1067", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8336, "upload_time": "2010-02-27T20:34:34", "url": "https://files.pythonhosted.org/packages/d8/d9/ed1382b63cfab3ee1cbe01ff84b864cc0400746b3800750211cd607866c9/django-mongokit-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "2a2bbd4560e63cd5c323aa55ae951c30", "sha256": "35d9d9a64e0be1f99468aef6444b3526eeadc82015cbb8182d61918409d11188" }, "downloads": -1, "filename": "django-mongokit-0.1.1.tar.gz", "has_sig": false, "md5_digest": "2a2bbd4560e63cd5c323aa55ae951c30", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8744, "upload_time": "2010-02-27T20:40:31", "url": "https://files.pythonhosted.org/packages/0b/03/2c27e8a4af16e29b25a0c9b4e2da883cfc4175816ecf7d1abfb0fc6ce205/django-mongokit-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "807a68828f37e7a47915935118078b6e", "sha256": "3986d0a5b1d15d1d05a5cbabe17924793da8c5e2cc8abc3f1e2447d9e6df87be" }, "downloads": -1, "filename": "django-mongokit-0.1.2.tar.gz", "has_sig": false, "md5_digest": "807a68828f37e7a47915935118078b6e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8763, "upload_time": "2010-02-27T20:42:52", "url": "https://files.pythonhosted.org/packages/e3/85/68914105647fdbc35f5febad12fa982582aebbb11555d83312e75e24924c/django-mongokit-0.1.2.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "9952b26290e0ec287c16b88271463720", "sha256": "dcbf6ed7704a66ffd0f475d4c4d8fea4d6f158a0aef9665656b9e2b90e6c2c25" }, "downloads": -1, "filename": "django-mongokit-0.1.4.tar.gz", "has_sig": false, "md5_digest": "9952b26290e0ec287c16b88271463720", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8819, "upload_time": "2010-02-27T20:52:36", "url": "https://files.pythonhosted.org/packages/7e/0c/fa5fd8ed37bfdcd6d23f8b891016edfc856329c2d54f7bea54ccc0652792/django-mongokit-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "bbf9007dde6731461fb6acba7e1732de", "sha256": "383394261d217becadc9fc6f04715a3546d3fc10e5de35daa3dbdeb12e2f2fea" }, "downloads": -1, "filename": "django-mongokit-0.1.5.tar.gz", "has_sig": false, "md5_digest": "bbf9007dde6731461fb6acba7e1732de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8864, "upload_time": "2010-02-27T20:58:09", "url": "https://files.pythonhosted.org/packages/f7/53/2e7dce97f613cf544eb91452af4ff93762bc02c89b49924b79da2d18399a/django-mongokit-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "5d022e3d332d6af5be02e8aecfbed35d", "sha256": "d2ee14ea202635c0b0a4761ae288a8d5a75bd37f5242647a81a1e56df4977bfd" }, "downloads": -1, "filename": "django-mongokit-0.1.6.tar.gz", "has_sig": false, "md5_digest": "5d022e3d332d6af5be02e8aecfbed35d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8819, "upload_time": "2010-03-10T11:58:53", "url": "https://files.pythonhosted.org/packages/4a/af/e91111c5c8c9e3953b667fb484f258dadb4febadacbaadeb228627c4d4b4/django-mongokit-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "613f9adbf09f742eafbd55a253828292", "sha256": "c2d0a7e22f2a4b118a37f85a48130162de7279336686e9772308a2ae72a9c7fd" }, "downloads": -1, "filename": "django-mongokit-0.1.7.tar.gz", "has_sig": false, "md5_digest": "613f9adbf09f742eafbd55a253828292", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9471, "upload_time": "2010-03-10T23:23:22", "url": "https://files.pythonhosted.org/packages/ea/bf/bbbbfc939607ea2efef8f1a41c6e5f7d587f72ae1c07d2de6fe4d91aeb5c/django-mongokit-0.1.7.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "9e377a638c51552a1fe4c4f405b67f60", "sha256": "b0fd50f5a7e19b2f6435727d22a8a12724d3469254335494424473ac8488023f" }, "downloads": -1, "filename": "django-mongokit-0.2.0.tar.gz", "has_sig": false, "md5_digest": "9e377a638c51552a1fe4c4f405b67f60", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12256, "upload_time": "2011-03-30T11:38:12", "url": "https://files.pythonhosted.org/packages/be/b6/56f890923a0324e611fcb44299b85924b9da126508dd82849054eb735efd/django-mongokit-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "479fd52d76ce5a050a450c8da278c18c", "sha256": "cec0651dc07ec0c859fb752aa7c0cc079679846fe826e9a7ba21263a01e0d3a0" }, "downloads": -1, "filename": "django-mongokit-0.2.1.tar.gz", "has_sig": false, "md5_digest": "479fd52d76ce5a050a450c8da278c18c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12231, "upload_time": "2011-04-07T09:44:13", "url": "https://files.pythonhosted.org/packages/e1/c3/e778ba723294a25ff689e3f732fff35ccc991f7266957151f4489d4e4051/django-mongokit-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "6bb56280151dc8ee17189c876e53e4c9", "sha256": "14b7d54cd3a165ae0d0d6a4ca3abcedef299ebc23b20efc4daf830660969bcf2" }, "downloads": -1, "filename": "django-mongokit-0.2.2.tar.gz", "has_sig": false, "md5_digest": "6bb56280151dc8ee17189c876e53e4c9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14980, "upload_time": "2011-04-07T09:48:26", "url": "https://files.pythonhosted.org/packages/2d/4c/7efbea2f7ec9c23a1ce331b4bccf7855cc4788d07f0eb3282736b748ad74/django-mongokit-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "3c984466a3e147cf5c126affcf15259e", "sha256": "5d152bed4f0a824f9b6d1d1b8ed4700cb932566091da52db4e9508cad6c583a5" }, "downloads": -1, "filename": "django-mongokit-0.2.3.tar.gz", "has_sig": false, "md5_digest": "3c984466a3e147cf5c126affcf15259e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14969, "upload_time": "2012-08-11T20:32:55", "url": "https://files.pythonhosted.org/packages/e8/e3/ea6d006a3d4c272b7244f146970faf69d45c4350c80c187db0187c023730/django-mongokit-0.2.3.tar.gz" } ], "0.2.3\n": [], "0.2.4-": [ { "comment_text": "", "digests": { "md5": "cd6e538084be48784707f4881d3a1a49", "sha256": "693a9ecb42d5e8d5fcc7960c159294c172fd08eb84ecf47bce38852b750f5327" }, "downloads": -1, "filename": "django-mongokit-0.2.4-.tar.gz", "has_sig": false, "md5_digest": "cd6e538084be48784707f4881d3a1a49", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14335, "upload_time": "2013-03-11T15:52:15", "url": "https://files.pythonhosted.org/packages/d6/7e/6aacd4475d446829fa9ad6d1548317bcfd08b412e7b11f3d8a54a4464f46/django-mongokit-0.2.4-.tar.gz" } ], "0.2.5": [ { "comment_text": "", "digests": { "md5": "262d659133f85627b600ed300d8f8cb1", "sha256": "024eb8f27156d086c2f11d2a42a9985c2ae9080be3deb9f5a9a7a84eb86de5fa" }, "downloads": -1, "filename": "django-mongokit-0.2.5.tar.gz", "has_sig": false, "md5_digest": "262d659133f85627b600ed300d8f8cb1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15815, "upload_time": "2013-03-20T23:06:37", "url": "https://files.pythonhosted.org/packages/c4/fa/6e6cd4f4f69582ef4a2dbcaec79a95875e70e7d55f8fc505be73d29583e9/django-mongokit-0.2.5.tar.gz" } ], "0.2.6": [ { "comment_text": "", "digests": { "md5": "94e11def2c2f96388c02454cff026024", "sha256": "bd298f883fc3c8d4518ad95885962e34e1e7c47e49a64fb241275da9873b3de0" }, "downloads": -1, "filename": "django-mongokit-0.2.6.tar.gz", "has_sig": false, "md5_digest": "94e11def2c2f96388c02454cff026024", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15870, "upload_time": "2013-08-28T17:03:28", "url": "https://files.pythonhosted.org/packages/50/3f/384607af386dcc52737c4dcc001f899f363ca5cc47cfee72ddd3d7ca13a0/django-mongokit-0.2.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "94e11def2c2f96388c02454cff026024", "sha256": "bd298f883fc3c8d4518ad95885962e34e1e7c47e49a64fb241275da9873b3de0" }, "downloads": -1, "filename": "django-mongokit-0.2.6.tar.gz", "has_sig": false, "md5_digest": "94e11def2c2f96388c02454cff026024", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15870, "upload_time": "2013-08-28T17:03:28", "url": "https://files.pythonhosted.org/packages/50/3f/384607af386dcc52737c4dcc001f899f363ca5cc47cfee72ddd3d7ca13a0/django-mongokit-0.2.6.tar.gz" } ] }