Skip to content

Commit 4c08bbb

Browse files
committed
Merge branch 'master' into hotfix/pkchain
2 parents d6e1b88 + 4814421 commit 4c08bbb

File tree

7 files changed

+45
-7
lines changed

7 files changed

+45
-7
lines changed

django_mongodb_engine/compiler.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ def add_filters(self, filters, query=None):
136136
query = self._mongo_query
137137

138138
if filters.connector == OR:
139+
assert '$or' not in query, "Multiple ORs are not supported"
139140
or_conditions = query['$or'] = []
140141

141142
if filters.negated:
@@ -153,7 +154,7 @@ def add_filters(self, filters, query=None):
153154
raise DatabaseError("Nested ORs are not supported")
154155

155156
if filters.connector == OR and filters.negated:
156-
raise NotImplementedError("Negated ORs are not implemented")
157+
raise NotImplementedError("Negated ORs are not supported")
157158

158159
self.add_filters(child, query=subquery)
159160

django_mongodb_engine/creation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def get_column_name(field):
7878

7979
def _handle_oldstyle_indexes(self, ensure_index, meta):
8080
from warnings import warn
81-
warn("'descending_indexes', 'sparse_indexes' and 'index_together' are"
81+
warn("'descending_indexes', 'sparse_indexes' and 'index_together' are "
8282
"deprecated and will be ignored as of version 0.6. "
8383
"Use 'indexes' instead", DeprecationWarning)
8484
sparse_indexes = []

django_mongodb_engine/south.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class DatabaseOperations(object):
77

88
supports_foreign_keys = False
99
has_check_constraints = False
10+
has_ddl_transactions = False
1011

1112
def __init__(self, db_alias):
1213
pass
@@ -37,3 +38,33 @@ def delete_table(self, table_name, cascade=True):
3738

3839
def connection_init(self):
3940
pass
41+
42+
def send_pending_create_signals(self, verbosity=False, interactive=False):
43+
pass
44+
45+
def get_pending_creates(self):
46+
pass
47+
48+
def start_transaction(self):
49+
pass
50+
51+
def rollback_transaction(self):
52+
pass
53+
54+
def rollback_transactions_dry_run(self):
55+
pass
56+
57+
def clear_run_data(self, pending_creates):
58+
pass
59+
60+
def create_table(self, unique=True, null=True, blank=True):
61+
pass
62+
63+
def send_create_signal(self, verbosity=False, interactive=False):
64+
pass
65+
66+
def execute_deferred_sql(self):
67+
pass
68+
69+
def commit_transaction(self):
70+
pass

docs/source/meta/contributing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@ use `GitHub's pull requests`_. It's perfectly fine, however, to send regular
4444
patches to :ref:`the mailing list <contributing/mailinglist>`.
4545

4646
.. _mailing list: http://groups.google.com/group/django-non-relational
47-
.. _on Github: https://github.com/django-mongodb-engine
48-
.. _ticket tracker on GitHub: https://github.com/django-mongodb-engine/mongodb-engine/issues/
47+
.. _on Github: https://github.com/django-nonrel
48+
.. _ticket tracker on GitHub: https://github.com/django-nonrel/mongodb-engine/issues/
4949
.. _GitHub's pull requests: http://help.github.com/pull-requests/

docs/source/topics/cache.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Installation
2828
------------
2929
.. code-block:: bash
3030
31-
git clone https://github.com/django-mongodb-engine/mongodb-cache
31+
git clone https://github.com/django-nonrel/mongodb-cache
3232
cd mongodb-cache
3333
python setup.py install
3434
@@ -50,5 +50,5 @@ Django MongoDB Cache will also honor all optional settings the default database
5050
cache backend takes care of (``TIMEOUT``, ``OPTIONS``, etc).
5151

5252
.. _Django's caching framework: http://docs.djangoproject.com/en/dev/topics/cache/
53-
.. _Django MongoDB Cache: https://github.com/django-mongodb-engine/mongodb-cache
53+
.. _Django MongoDB Cache: https://github.com/django-nonrel/mongodb-cache
5454
.. _Django db cache setup docs: http://docs.djangoproject.com/en/dev/topics/cache/#database-caching

docs/source/topics/setup.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Django MongoDB Engine
4343
.....................
4444
You should use the latest Git revision. ::
4545

46-
pip install git+https://github.com/django-mongodb-engine/mongodb-engine
46+
pip install git+https://github.com/django-nonrel/mongodb-engine
4747

4848

4949
Configuration

tests/mongodb/tests.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from django.core.management import call_command
33
from django.db import connection, connections
44
from django.db.utils import DatabaseError, IntegrityError
5+
from django.db.models import Q
56
from django.contrib.sites.models import Site
67

78
from pymongo.objectid import InvalidId
@@ -170,6 +171,11 @@ def test_multiple_exclude_random(self):
170171
q = getattr(q, 'filter' if randint(0, 1) else 'exclude')(raw=i)
171172
list(q)
172173

174+
def test_issue_89(self):
175+
query = [Q(raw='a') | Q(raw='b'),
176+
Q(raw='c') | Q(raw='d')]
177+
self.assertRaises(AssertionError, RawModel.objects.get, *query)
178+
173179
class DatabaseOptionTests(TestCase):
174180
""" Tests for MongoDB-specific database options """
175181

0 commit comments

Comments
 (0)