Skip to content

Commit

Permalink
Definitely hardcoding to 'id' column as pk should be replaced to 'pk'…
Browse files Browse the repository at this point in the history
… attribute
  • Loading branch information
belonesox committed May 30, 2021
1 parent 4906d0e commit 90abc6d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/prefetch.py
Expand Up @@ -194,7 +194,7 @@ def decorator(user, user_group_associations=()):
* mapper(object):
Optional (defaults to ``lambda obj: obj.id``).
Optional (defaults to ``lambda obj: obj.pk``).
A function that returns the key for a given object in your query set.
Expand Down Expand Up @@ -232,7 +232,7 @@ def __init__(self, filter=None, reverse_mapper=None, decorator=None, mapper=None

@staticmethod
def mapper(obj):
return obj.id
return obj.pk

def fetch(self, dataset, name, model, forwarders, db):
collect = self.collect or forwarders
Expand Down

0 comments on commit 90abc6d

Please sign in to comment.