diff options
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/sharding/attribute_shard.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/sharding/attribute_shard.py b/examples/sharding/attribute_shard.py index 25da98872..0a9e992a3 100644 --- a/examples/sharding/attribute_shard.py +++ b/examples/sharding/attribute_shard.py @@ -22,6 +22,7 @@ from sqlalchemy import * from sqlalchemy.orm import * from sqlalchemy.orm.shard import ShardedSession from sqlalchemy.sql import operators +from sqlalchemy import sql import datetime # step 2. databases @@ -107,7 +108,7 @@ shard_lookup = { # note that we need to define conditions for # the WeatherLocation class, as well as our secondary Report class which will # point back to its WeatherLocation via its 'location' attribute. -def shard_chooser(mapper, instance): +def shard_chooser(mapper, instance, clause=None): if isinstance(instance, WeatherLocation): return shard_lookup[instance.continent] else: |
