Next / Previous / Contents / Shipman's homepage

23.25. MonthCell.__floc(): Generate one of multiple sightings

When there are multiple sightings of a form, each is packaged in its own div element with class=FLOC_CLASS. For general notes on rendering, see Section 23.19, “MonthCell.__birdForm(): Render one BirdForm.

noteweb
# - - -   M o n t h C e l l . _ _ f l o c

    def __floc ( self, parent, sight ):
        '''Render one sighting in the multi-sighting case.

          [ (parent is an et.Element) and
            (sight is a birdnotes.sighting instance) ->
              parent  +:=  XHTML rendering of sight, packaged in
                  a separate div ]
        '''
        #-- 1 --
        # [ parent  +:=  a new div element with class=FLOC_CLASS
        #   div  :=  that div element ]
        div  =  et.SubElement ( parent, 'div' )
        div.attrib['class']  =  FLOC_CLASS        

See Section 23.26, “MonthCell.__ageSexGroup(): Render age-sex-group content”.

noteweb
        #-- 2 --
        # [ if sight.ageSexGroup is not None ->
        #     div  +:=  XHTML rendering of sight.ageSexGroup
        #   else -> I ]
        if sight.ageSexGroup is not None:
            self.__ageSexGroup ( div, sight.ageSexGroup )

See Section 23.22, “MonthCell.__locGroup(): Render a locality group”.

noteweb
        #-- 3 --
        # [ div  +:=  XHTML rendering of sight's effective locality ]
        self.__locGroup ( div, sight.getLocGroup() )

See Section 23.23, “MonthCell.__sightNotes(): Render a sighting notes group”.

noteweb
        #-- 4 --
        # [ if sight.sightNotes is not None ->
        #     div  +:=  XHTML rendering of sight.sightNotes
        #   else -> I ]
        if sight.sightNotes is not None:
            self.__sightNotes ( div, sight.sightNotes )