Skip to content

Commit

Permalink
Don't delude we're quoting anything and simplify update_entity.
Browse files Browse the repository at this point in the history
  • Loading branch information
wrwrwr committed Feb 20, 2012
1 parent cfc16fb commit 8f81ef7
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions db/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,6 @@ def update_entity(self, pk, pk_field):
if not gae_query.matches_filters(entity):
return

qn = self.quote_name_unless_alias
update_dict = {}
for field, _, value in self.query.values:
if hasattr(value, 'prepare_database_save'):
value = value.prepare_database_save(field)
Expand All @@ -422,14 +420,9 @@ def update_entity(self, pk, pk_field):
allow_joins=False)

if hasattr(value, 'as_sql'):
# Evaluate expression and return the new value.
val = value.as_sql(qn, self.connection)
update_dict[field] = val
else:
update_dict[field] = value
value = value.as_sql(lambda n: n, self.connection)

for field, value in update_dict.iteritems():
entity[qn(field.column)] = self.value_for_db(value, field)
entity[field.column] = self.value_for_db(value, field)

Put(entity)

Expand Down

0 comments on commit 8f81ef7

Please sign in to comment.