Skip to content

Commit

Permalink
Compare lazy views instances by import names, not by views.
Browse files Browse the repository at this point in the history
  • Loading branch information
playpauseandstop committed Aug 3, 2014
1 parent 26c6f53 commit c7315f4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions flask_lazyviews/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,19 @@ def __call__(self, *args, **kwargs):

def __eq__(self, other):
"""
Check that two lazy view instances has equal view or not.
Check that two lazy view instances have equal views or not.
"""
try:
return self.view == other.view
return self.import_name == other.import_name
except (AttributeError, ImportError):
return False

def __ne__(self, other):
"""
Check that two lazy view instance have not equals views.
"""
return not self.__eq__(other)

def __getattribute__(self, name):
"""
Proxify documentation attribute from original view if it could be
Expand Down

0 comments on commit c7315f4

Please sign in to comment.