Skip to content
This repository has been archived by the owner on Jul 24, 2018. It is now read-only.

Commit

Permalink
Adjust, fix, and add some __repr__ methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphbean committed Jul 18, 2014
1 parent ef1c9c7 commit 3d1e3cb
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions fmn/lib/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def __json__(self):
}

def __repr__(self):
return "<fmn.lib.models.User %r %r>" % (self.openid, self.openid_url)
return "<fmn.lib.models.User: %r %r>" % (self.openid, self.openid_url)

@classmethod
def by_openid(cls, session, openid):
Expand Down Expand Up @@ -248,7 +248,7 @@ def __json__(self):
}

def __repr__(self):
return "<fmn.lib.models.Rule %r(**%r)>" % (
return "<fmn.lib.models.Rule: %r(**%r)>" % (
self.code_path, self.arguments)

@hybrid_property
Expand Down Expand Up @@ -316,7 +316,7 @@ def __json__(self):
}

def __repr__(self):
return "<fmn.lib.models.Filter %r>" % (self.name)
return "<fmn.lib.models.Filter: %r>" % (self.name)

@classmethod
def create(cls, session, name):
Expand Down Expand Up @@ -442,6 +442,10 @@ def __json__(self):
'detail_values': [v.value for v in self.detail_values],
}

def __repr__(self):
return "<fmn.lib.models.Preference: %r %r>" % (
self.openid, self.context_name)

@property
def should_batch(self):
""" If the user has any batching preferences at all, then we should """
Expand Down Expand Up @@ -648,8 +652,8 @@ class Confirmation(BASE):
sa.UniqueConstraint('openid', 'context_name'),
)

def repr(self):
return "<Confirmation user:%s, context:%s, status:%s>" % (
def __repr__(self):
return "<fmn.lib.models.Confirmation: %r %r %r>" % (
self.openid, self.context_name, self.status)

@classmethod
Expand Down

0 comments on commit 3d1e3cb

Please sign in to comment.