Next / Previous / Contents / Shipman's homepage

14. class AgeSexGroup: Sighting core data

This class represents content from the age-sex-group pattern in the schema. See the definition of this pattern in the schema.

birdnotes.py
# - - - - -   c l a s s   A g e S e x G r o u p

class AgeSexGroup:
    """Represents assorted details of birds sighted.

      Exports:
        AgeSexGroup ( age=None, sex=None, q=None, count=None,
                      fide=None ):
          [ (age is an age code or None) and
            (sex is a sex code or None) and
            (q is a countability flag or None) and
            (count is a count description string or None) and
            (fide is an attribution or None) ->
              return a new AgeSexGroup instance with those values ]
        AgeSexGroup.readNode ( node ):    # Static method
          [ node is an et.Element ->
              if node has any age-sex-group content ->
                return an AgeSexGroup instance representing that
                content
              else -> return None ]
        .writeNode ( parent ):
          [ parent is an et.Element ->
              parent  :=  parent with self's age-sex-group
                  content attached ]
    """

14.1. AgeSexGroup.__init__()

birdnotes.py
# - - -   A g e S e x G r o u p . _ _ i n i t _ _

    def __init__ ( self, age=None, sex=None, q=None, count=None,
                   fide=None ):
        """Constructor for AgeSexGroup.
        """
        self.age  =  age
        self.sex  =  sex
        self.q  =  q
        self.count  =  count
        self.fide  =  fide