Skip to content

Commit

Permalink
implementing __int__() to allow casting PrefProxy to int
Browse files Browse the repository at this point in the history
  • Loading branch information
yoandym committed Apr 23, 2015
1 parent 669ed99 commit b9c479e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions siteprefs/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ def __str__(self):
def __repr__(self):
return '%s = %s' % (self.name, self.get_value())

def __int__(self):
return int(self.get_value())


def get_field_for_proxy(pref_proxy):
"""Returns a field object instance for a given PrefProxy object."""
Expand Down

0 comments on commit b9c479e

Please sign in to comment.