コード例 #1
0
    def list_name(self):
        """The list name for the Spine (or sub-class)

        What should a collection of these things be called ?

        >>> Spine().list_name() == 'Spines'
        True
        """
        return pluralize(self.class_name())
コード例 #2
0
    def list_name(self):
        """The plural of the class name

        Intended as the name to use for a list of these objects

        >>> print Tally().list_name()
        Tallies
        """
        try:
            list_of_items = self[0].list_name()
        except AttributeError:
            list_of_items = ''
        except IndexError:
            list_of_items = ''
        if self.class_name() == list_of_items:
            return self.class_name()
        return pluralize(self.class_name())