Esempio n. 1
0
def lendable_choices():
    """Generate a tuple of lendable choices.

    Returns:
        A tuple containing value/label pairs representing the
        lendable choices for a select widget.
    """
    choices = (('', 'Choose lendable ...'),
               ('all', 'All lendables'))

    choices += tuple((lendable.__name__.lower(), lendable.name)
                     for lendable in Lendable.__subclasses__())

    return choices