~ubuntu-branches/debian/sid/sqlalchemy/sid

« back to all changes in this revision

Viewing changes to lib/sqlalchemy/orm/strategies.py

  • Committer: Package Import Robot
  • Author(s): Piotr Ożarowski
  • Date: 2014-06-27 20:17:13 UTC
  • mfrom: (1.4.28)
  • Revision ID: package-import@ubuntu.com-20140627201713-g6p1kq8q1qenztrv
Tags: 0.9.6-1
* New upstream release
* Remove Python 3.X build tag files, thanks to Matthias Urlichs for the
  patch (closes: #747852)
* python-fdb isn't in the Debian archive yet so default dialect for firebird://
  URLs is changed to obsolete kinterbasdb, thanks to Russell Stuart for the
  patch (closes: #752145)

Show diffs side-by-side

added added

removed removed

Lines of Context:
208
208
 
209
209
    def setup_query(self, context, entity, path, loadopt, adapter,
210
210
                                only_load_props=None, **kwargs):
 
211
 
211
212
        if (
212
 
                loadopt and self.group and
 
213
            (
 
214
                loadopt and
 
215
                'undefer_pks' in loadopt.local_opts and
 
216
                set(self.columns).intersection(self.parent.primary_key)
 
217
            )
 
218
            or
 
219
            (
 
220
                loadopt and
 
221
                self.group and
213
222
                loadopt.local_opts.get('undefer_group', False) == self.group
214
 
            ) or (only_load_props and self.key in only_load_props):
 
223
            )
 
224
            or
 
225
            (
 
226
                only_load_props and self.key in only_load_props
 
227
            )
 
228
        ):
215
229
            self.parent_property._get_strategy_by_cls(ColumnLoader).\
216
230
                            setup_query(context, entity,
217
231
                                        path, loadopt, adapter, **kwargs)
885
899
                    attr = getattr(parent_alias, key).\
886
900
                                    of_type(effective_entity)
887
901
                else:
888
 
                    attr = key
 
902
                    attr = getattr(mapper.entity, key)
889
903
 
890
904
            if second_to_last:
891
905
                q = q.join(parent_alias, attr, from_joinpoint=True)
1033
1047
    def setup_query(self, context, entity, path, loadopt, adapter, \
1034
1048
                                column_collection=None, parentmapper=None,
1035
1049
                                **kwargs):
1036
 
        """Add a left outer join to the statement thats being constructed."""
 
1050
        """Add a left outer join to the statement that's being constructed."""
1037
1051
 
1038
1052
        if not context.query._enable_eagerloads:
1039
1053
            return
1337
1351
            self.mapper.identity_key_from_row(row, decorator)
1338
1352
            return decorator
1339
1353
        except KeyError:
1340
 
            # no identity key - dont return a row
 
1354
            # no identity key - don't return a row
1341
1355
            # processor, will cause a degrade to lazy
1342
1356
            return False
1343
1357