Skip to content

Commit

Permalink
Parenthesis imports and XXXs.
Browse files Browse the repository at this point in the history
  • Loading branch information
wrwrwr committed Feb 21, 2012
1 parent 61a4e01 commit 77a4e19
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
10 changes: 7 additions & 3 deletions djangotoolbox/db/base.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import cPickle as pickle
import datetime

from django.db.backends import BaseDatabaseFeatures, BaseDatabaseOperations, \
BaseDatabaseWrapper, BaseDatabaseClient, BaseDatabaseValidation, \
BaseDatabaseIntrospection
from django.db.backends import (
BaseDatabaseFeatures,
BaseDatabaseOperations,
BaseDatabaseWrapper,
BaseDatabaseClient,
BaseDatabaseValidation,
BaseDatabaseIntrospection)
from django.db.utils import DatabaseError
from django.utils.functional import Promise
from django.utils.safestring import EscapeString, EscapeUnicode, SafeString, \
Expand Down
9 changes: 4 additions & 5 deletions djangotoolbox/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ def get_db_prep_lookup(self, lookup_type, value, connection,
Passes the value through get_db_prep_lookup of item_field.
"""

# TODO: Remove as_lookup_value() once we have a cleaner solution
# for dot-notation queries.
# TODO/XXX: Remove as_lookup_value() once we have a cleaner
# solution for dot-notation queries.
# See: https://groups.google.com/group/django-non-relational/browse_thread/thread/6056f8384c9caf04/89eeb9fb22ad16f3).
if hasattr(value, 'as_lookup_value'):
value = value.as_lookup_value(self, lookup_type, connection)
Expand Down Expand Up @@ -360,7 +360,6 @@ def get_db_prep_save(self, embedded_instance, connection):
field.pre_save(embedded_instance, add), connection=connection)

# Exclude unset primary keys (e.g. {'id': None}).
# TODO: Why?
if field.primary_key and value is None:
continue

Expand All @@ -380,12 +379,12 @@ def get_db_prep_save(self, embedded_instance, connection):
(model_field, embedded_instance.__class__.__name__)))

# This instance will exist in the database soon.
# TODO: Ensure that this doesn't cause race conditions.
# TODO.XXX: Ensure that this doesn't cause race conditions.
embedded_instance._entity_exists = True

return field_values

# TODO: Remove this once we have a cleaner solution.
# TODO/XXX: Remove this once we have a cleaner solution.
def get_db_prep_lookup(self, lookup_type, value, connection,
prepared=False):
if hasattr(value, 'as_lookup_value'):
Expand Down

0 comments on commit 77a4e19

Please sign in to comment.