Saturday, February 7, 2015

Solved some minor problems with lino.modlib.polls.

In CPAS de Châtelet they didn’t yet start to manually configure polls, so I use the following script in order to initialize the polls:

from lino.api import rt
rt.startup()

rt.modules.polls.ChoiceSet.objects.all().delete()
rt.modules.polls.Question.objects.all().delete()
rt.modules.polls.Poll.objects.all().delete()
rt.modules.polls.AnswerChoice.objects.all().delete()
rt.modules.polls.AnswerRemark.objects.all().delete()
rt.modules.polls.Response.objects.all().delete()

from lino_welfare.modlib.polls.fixtures import std, demo

from lino.utils.dpy import load_fixture_from_module

load_fixture_from_module(std)
load_fixture_from_module(demo)

obj = rt.modules.polls.Poll.get_by_ref("RAE")
rt.show(rt.modules.polls.QuestionsByPoll, obj)

ResponsesByPartner.get_slave_summary() now displays insert buttons.