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.models.polls.ChoiceSet.objects.all().delete()
rt.models.polls.Question.objects.all().delete()
rt.models.polls.Poll.objects.all().delete()
rt.models.polls.AnswerChoice.objects.all().delete()
rt.models.polls.AnswerRemark.objects.all().delete()
rt.models.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.models.polls.Poll.get_by_ref("RAE")
rt.show(rt.models.polls.QuestionsByPoll, obj)

ResponsesByPartner.get_slave_summary() now displays insert buttons.