Permalink
Browse files

Merge pull request #1 from ferrix/client

Stop using deprecated Connection class
  • Loading branch information...
fatiherikli committed Mar 7, 2013
2 parents 0279fa4 + a1410d5 commit 11810a910b8b9184bfe018bf3c1a310a1d4f6389
Showing with 3 additions and 3 deletions.
  1. +3 −3 tastypie_mongodb/resources.py
@@ -1,5 +1,5 @@
from bson import ObjectId
-from pymongo import Connection
+from pymongo import MongoClient
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import reverse
@@ -9,7 +9,7 @@
from tastypie.resources import Resource
-db = Connection(
+db = MongoClient(
host=getattr(settings, "MONGODB_HOST", None),
port=getattr(settings, "MONGODB_PORT", None)
)[settings.MONGODB_DATABASE]
@@ -87,4 +87,4 @@ def get_resource_uri(self, item):
return reverse("api_dispatch_detail", kwargs={
"resource_name": self._meta.resource_name,
"pk": pk
- })
+ })

0 comments on commit 11810a9

Please sign in to comment.