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

15. indexUser(): Add one user to the KWIC index

homelist2
# - - -   i n d e x U s e r

def indexUser(kwicIndex, webUser):
    '''Index all the keywords in one user's GECOS name.

      [ (kwicIndex is a kwic.KwicIndex instance) and
        (webUser is a WebUser instance) ->
          kwicIndex  :=  kwicIndex with entries added indexing
              the user represented by webUser ]
    '''

The entries in a KwicIndex carry a user data value. In our case, that value will be the WebUser instance, so that the generated index entry can link to their homepage URL.

homelist2
    #-- 1 --
    kwicIndex.index(webUser.gecos, webUser)