Next / Previous / Contents / TCC Help System / NM Tech homepage

7.28. class UserRecord

An instance of this class holds everything we need to know about one user.

reader.cgi
# - - - - -   c l a s s   U s e r R e c o r d

class UserRecord:
    '''Record for one user.

      Exports:
        UserRecord ( userId, chapterNo, persist, expiration ):
          [ (userId is a string) and
            (chapterNo is an positive integer) and
            (persist is 1 for persistent cookie, 0 for session
            cookie) and
            (expiration is the user's expiration timestamp as
            an integer epoch time) ->
              return a new UserRecord with those values ]
        .userId:          [ as passed to constructor, read-write ]
        .chapterNo:       [ as passed to constructor, read-write ]
        .persist:         [ as passed to constructor, read-write ]
        .expiration:      [ as passed to constructor, read-write ]
    '''
    def __init__ ( self, userId, chapterNo, persist, expiration ):
        '''Constructor for UserRecord
        '''
        self.userId      =  userId
        self.chapterNo   =  chapterNo
        self.persist     =  persist
        self.expiration  =  expiration