← Back to team overview

schooltool-developers team mailing list archive

Removing intervention dependency on gradebook

 

Hey Justas,

I made the two changes we discussed at the meeting, fixing evolve7 and
fixing updatePersonsResponsible while adding test update views for
better test coverage.  Additionally, I made a couple more quick fixes
that involved re-organizing the code and zcml files in line with what
you had suggested at the sprint and moving all the templates into a
templates directory.  I like how much easier it is to find things this
way, and it was timely, too, because Filip will be building a similar
package in schooltool.courseinfo.  This way he has a better example in
schooltool.intervention.

Please take a close look at my most recent commit because I'd like to
fix anything you find wrong before the weekend is out.  The commit is
for removing dependency on schooltool.gradebook.  It involves three
packages being merged at the same time, the intervention branch and
two new branches I pushed,
lp:~aelkner/schooltool/independent_activities  and
lp:~aelkner/schooltool.gradebook/independent_activities.  This
requires changing buildout.cfg temporarily to point to a checkout of
my new core branch, so my sandbox has all three branches side by side,
and I tested adding and removing schooltool.gradebook from
buildout.cfg.

The way I removed the dependency was by defining an interface in
schooltool core called IIndependentActivites.  The intervention views
that used to look for IActivities(section), a gradebook dependency,
now adapt to IIndependentActivites.  If schooltool.gradebook is not in
the build, the adapter lookup will fail, returning None which the
intervention views will be able to handle.  If schooltool.gradebook is
in the build, it will supply the requested adapter, returning
IActivities(section) which is what the intervention views need.

I created stubs for this in ftests.py, only registered via
ftesting.zcml, that deliver a fake IActivities(section) heirachy,
allowing for more complete coverage of the views that formerly had the
gradebook dependency but didn't have any test coverage.  For this, I
created a functional test file, independent_activities.txt which, in
chosing the section title, is able to test how those views would
handle schooltool.gradebook presense or absense.

One last thing had to change, and it has been long overdue.  Until
now, schooltool.gradebook had a view for ISchooltoolApplication that
simply gives a message telling the user to set up a term.  I know that
you may have some ideas for what the view should say, so now would be
a good time for that.  In any event, I needed to move that view out of
schooltool.gradebook and into core so that the intervention package
could get at it.  Again, this is a reason that all three of my
branches have to merged at the same time.

Please give me the best feedback on the commit and the new branches
that you can by the end of your day.

Thanks,
Alan



Follow ups