+ class PublisherChoices(object):
+
+ def __iter__(self):
+ """Génère dynamiquement les choix possibles pour la recherche par éditeur."""
+ yield ('', '')
+ cursor = db.connection.cursor()
+ cursor.execute("SELECT DISTINCT publisher AS publisher FROM savoirs_record ORDER BY publisher")
+ for result in cursor.fetchall():
+ publisher = result[0]
+ if publisher not in ('', '-'):
+ yield (publisher, publisher)
+ PUBLISHER_CHOICES = PublisherChoices()
+