Skip to content

Commit

Permalink
fix #521 copy of dict to prevent it updates (#523)
Browse files Browse the repository at this point in the history
* fix #521 copy of dict to prevent it updates

* some PEP8 and typo fixes
  • Loading branch information
BuhtigithuB authored and mdipierro committed Feb 28, 2018
1 parent 79fa015 commit 3566e7f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pydal/adapters/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def expand_all(self, fields, tabledict):
return new_fields

def parse_value(self, value, field_itype, field_type, blob_decode=True):
#[Note - gi0baro] I think next if block can be (should be?) avoided
# [Note - gi0baro] I think next if block can be (should be?) avoided
if field_type != 'blob' and isinstance(value, str):
try:
value = value.decode(self.db._db_codec)
Expand Down Expand Up @@ -309,7 +309,7 @@ def parse(self, rows, fields, colnames, blob_decode=True, cacheable=False):
# Old style virtual fields
for tablename, tmp in fields_virtual.items():
table = tmp[0]
### old style virtual fields
# ## old style virtual fields
for item in table.virtualfields:
try:
rowsobj = rowsobj.setvirtualfields(**{tablename: item})
Expand All @@ -322,7 +322,7 @@ def iterparse(self, sql, fields, colnames, blob_decode=True,
cacheable=False):
"""
Iterator to parse one row at a time.
It doen't support the old style virtual fields
It doesn't support the old style virtual fields
"""
return IterRows(self.db, sql, fields, colnames, blob_decode, cacheable)

Expand Down Expand Up @@ -359,7 +359,7 @@ def before_execute(self, command):

class SQLAdapter(BaseAdapter):
commit_on_alter_table = False
#[Note - gi0baro] can_select_for_update should be deprecated and removed
# [Note - gi0baro] can_select_for_update should be deprecated and removed
can_select_for_update = True
execution_handlers = []
migrator_cls = Migrator
Expand Down Expand Up @@ -615,14 +615,14 @@ def _select_wcols(self, query, fields, left=False, join=False,
ijoin_tables, ijoin_on, itables_to_merge, ijoin_on_tables,
iimportant_tablenames, iexcluded, itablemap
) = self._build_joins_for_select(tablemap, join)
tablemap = merge_tablemaps(tablemap, itables_to_merge)
tablemap = merge_tablemaps(tablemap, dict(**itables_to_merge))
tablemap = merge_tablemaps(tablemap, itablemap)
if left:
(
join_tables, join_on, tables_to_merge, join_on_tables,
important_tablenames, excluded, jtablemap
) = self._build_joins_for_select(tablemap, left)
tablemap = merge_tablemaps(tablemap, tables_to_merge)
tablemap = merge_tablemaps(tablemap, dict(**tables_to_merge))
tablemap = merge_tablemaps(tablemap, jtablemap)
current_scope = outer_scoped + list(tablemap)
query_env = dict(current_scope=current_scope,
Expand Down

0 comments on commit 3566e7f

Please sign in to comment.