Simplify filter_by_access boilerplate code

This commit is contained in:
Roberto Rosario
2016-11-02 03:48:16 -04:00
parent c0194c63dc
commit 621c988809
29 changed files with 173 additions and 376 deletions

View File

@@ -358,9 +358,11 @@ class SourceColumn(object):
return cls._registry[source]
except KeyError:
try:
# Try it as a queryset
return cls._registry[source.model]
except AttributeError:
try:
# It seems to be an instance, try its class
return cls._registry[source.__class__]
except KeyError:
try: