schooltool-developers team mailing list archive
-
schooltool-developers team
-
Mailing list archive
-
Message #00335
Re: Intervention refactoring
-
To:
schooltool-developers@xxxxxxxxxxxxxxxxxxx
-
From:
Justas <justas@xxxxxx>
-
Date:
Mon, 07 Mar 2011 10:14:25 +0200
-
In-reply-to:
<AANLkTi=7i=MsCpBFQhtMB=KKsBE43-0_QJj_wH9u8H=k@mail.gmail.com>
-
User-agent:
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8
On 03/07/2011 08:36 AM, Alan Elkner wrote:
Hey Justas,
I got the first part of the intervention refactoring done with
changing everything to use adapters. I did the adaptation from the
various intervention objects to IPerson to replace the student
property as we discussed, but I also replaced the many helper methods
for acquiring the intervention objects with adapters as well. It
makes the code a lot cleaner. I also broke out all the adapters from
intervention.py into a new file called adapters.py to make it easier
to find/scroll the code. I'm taking your sprint suggestion to heart
about splitting files up when convenient.
Could you please give my branch,
lp:~aelkner/schooltool.intervention/test_coverage, a look for the
upcoming meeting? I'd ready to move onto the next part which is
replacing the ids with relationships to contacts, that is, unless you
think I have any unfinished business with the adapter part.
Took a brief look, it looks great.
Few small notes:
Maybe it makes sense to write adapters to IContact directly for some
intervention objects? I noticed some repetition of
IContact(IPerson(some_context)). If you tend to use those a lot, then
it may make sense to have, say, IContact(intervention_goal).
In src/schooltool/intervention/browser/intervention.py, line 115,
cell_formatter, there's a new comment:
# need to auto-vivyfy because we give the user a link to it
I'd say it even deserves an "XXX: " - checking+creation should
definitely not be done in a method that formats url for representation.
Thanks for noticing! :)
Keep up the good work!
Justas
References