コード例 #1
0
ファイル: user.py プロジェクト: ksuarz/shrunk
class User(UserMixin):
    """A User object used for logging in."""
    def __init__(self, netid):
        self.netid = netid
        self.id = netid
        self.client = ShrunkClient()

    def is_active(self):
        """Determines whether or not a user is active."""
        return not self.client.is_blacklisted(self.netid)

    def is_admin(self):
        """Determines whether or not this user is an administrator."""
        return self.client.is_admin(self.netid)

    def __str__(self):
      """Returns the NetID of this user."""
      return self.netid

    def __repr__(self):
      """Returns the NetID of this user."""
      return self.netid
コード例 #2
0
ファイル: user.py プロジェクト: ksuarz/shrunk
 def __init__(self, netid):
     self.netid = netid
     self.id = netid
     self.client = ShrunkClient()