schooltool-developers team mailing list archive
-
schooltool-developers team
-
Mailing list archive
-
Message #00163
Fwd: Import xls error
---------- Forwarded message ----------
From: Alan Elkner <aelkner@xxxxxxxxx>
Date: Sun, May 23, 2010 at 11:21 PM
Subject: Re: Import xls error
To: Jen Overgaag <jovergaag@xxxxxxxxx>
Cc: Tom Hoffman <tom.hoffman@xxxxxxxxx>, gonzaloportal
<gonzaloportal56@xxxxxxxxxxx>, peter.walinkonde@xxxxxxxxx
Hi Jen,
I worked out all the changes that needed to made to your xls file to
get it to import into schooltool, so I attached the updated file so
that you can try it out again. The following changes needed to be
made:
1) removed the 'Sections' sheets as we will be generating the sections
from the FET import
2) fixed the 'Groups' sheet to have IDs that match the titles, school
years that are strings, and 'Members' instead of 'Names'
3) created a 'School Years' sheet that has the school year in it
(start and end dates? I chose begin and end of 2010.)
If you try the file again, it will import, and then you will see the
link at the top for school year, 2010. When you click on that, you
will see the view for the school year. In that view you will see a
Groups link. Clink on that, and you will see the groups you defined
in your xls file with all of the students as members. Since you are
using the standard schooltool package, you won't see anything about
grade levels there, but you will in your custom package (more on that
later). Also, don't mind the presence of the other groups that you
see there as they are created by schooltool by default for each school
year. We will be making use of them later.
Getting back to the school year view (clicking on the 2010 at the
top), I'd like to point your attention to the following:
1) There is a term set up that has the same start and end date as the
school year.
2) Clicking on the Courses link shows that there are no courses set
up. You need to add lines to the Courses sheet, one per Subject in
FET, with the school year being 2010 (make sure it's a string), the ID
being the FET code for the Subject (apparently all caps) and any title
and description you choose. We will be using the course ID to match
up with the FET import data later.
3) There are no timetables set up, again not until the FET import.
After the xls file is successfully imported, the FET data needs to be
imported to complete the picture. That brings me to the custom
package that we are making for you. It's called schooltool.zambia,
and it contains the code to import the FET data into the school year
you just set up. When you click on the 2010 at the top, using the
custom package, you will see an 'Import FET data' link with the
actions links right below the solid red bar at the top. Clicking on
that will give you the opportunity to upload all of the timetable data
to scbooltool which will result in the creation of the timetable and
the classes (we call them sections) that are scheduled on that
timetable, ready with the appropriate group of students enrolled. I
hope to get that to you for testing by the end of the week.
In the meantime, please update the xls file I attached (and return to
me) with the Courses sheet having all your Subjects. Also, please add
the teachers to the Person sheet. I don't think it makes sense to
force you to use all caps for the teachers' user names to get them to
match the FET data. It seems harsh to force teachers to use caps when
logging in, so I will make sure the code matches FET teachers to
schooltool teachers without regard to case.
So, to summarize, the process will be as follows:
1) Start with no school year defined in schooltool. This entire
process can be repeated as many times as we need to get it right
simply by removing the school year that is there from the last time we
did these steps.
2) Import the xls file to create the school year, courses and student
groups. The person objects for the teachers and students will be
created the first time you do this step, then just harmlessly updated
any subsequent time.
3) Go to the school year view and import the FET data. More
instructions will come with the custom package.
I will keep you informed of the status of the custom package as the
week progresses.
Thanks,
Alan
On Thu, May 20, 2010 at 4:25 AM, Jen Overgaag <jovergaag@xxxxxxxxx> wrote:
> Hello,
>
> I am trying to import students and I'm getting an error when I try to
> specify groups. Below is the error message and attached is the file I'm
> trying to import. I assume that I have the layout wrong somewhere.
>
> Things I've tried:
> -deleting all duplicate persons data
> -removing references and functions and only hard coding names
> -adding the group name by the web interface first
>
> Sorry for the direct question, I still haven't set up an IRC client.
>
>
>
>
> Exception
>
> KeyError: 2010.0
>
> Traceback
>
> File "/usr/lib/python2.6/dist-packages/zope/publisher/publish.py", line
> 134, in publish
>
> result = publication.callObject(request, obj)
> File
> "/usr/lib/python2.6/dist-packages/zope/app/publication/zopepublication.py",
> line 205, in callObject
>
> return mapply(ob, request.getPositionalArguments(), request)
> File "/usr/lib/python2.6/dist-packages/zope/publisher/publish.py", line 109,
> in mapply
>
> return debug_call(obj, args)
> Extra information: <zope.browserpage.simpleviewclass.SimpleViewClass from
> /usr/lib/python2.6/dist-packages/schooltool/export/templates/import.pt
> object at 0xdf95e0c>
>
> File "/usr/lib/python2.6/dist-packages/zope/publisher/publish.py", line 115,
> in debug_call
> return obj(*args)
>
> File "/usr/lib/python2.6/dist-packages/zope/browserpage/simpleviewclass.py",
> line 44, in __call__
> return self.index(*args, **kw)
>
> File
> "/usr/lib/python2.6/dist-packages/zope/browserpage/viewpagetemplatefile.py",
> line 83, in __call__
> return self.im_func(im_self, *args, **kw)
>
> File
> "/usr/lib/python2.6/dist-packages/zope/browserpage/viewpagetemplatefile.py",
> line 51, in __call__
> sourceAnnotations=getattr(debug_flags, 'sourceAnnotations', 0),
>
> File "/usr/lib/python2.6/dist-packages/zope/pagetemplate/pagetemplate.py",
> line 115, in pt_render
> strictinsert=0, sourceAnnotations=sourceAnnotations)()
>
> Template
> "/usr/lib/python2.6/dist-packages/schooltool/export/templates/import.pt"
> File "/usr/lib/python2.6/dist-packages/zope/tal/talinterpreter.py", line
> 271, in __call__
>
> self.interpret(self.program)
> File "/usr/lib/python2.6/dist-packages/zope/tal/talinterpreter.py", line
> 343, in interpret
>
> handlers[opcode](self, args)
> File "/usr/lib/python2.6/dist-packages/zope/tal/talinterpreter.py", line
> 583, in do_setLocal_tal
>
> self.engine.setLocal(name, self.engine.evaluateValue(expr))
> File "/usr/lib/python2.6/dist-packages/zope/tales/tales.py", line 696, in
> evaluate
>
> return expression(self)
> Template
> "/usr/lib/python2.6/dist-packages/schooltool/export/templates/import.pt",
> line 1, column 0
>
> Expression: <PathExpr standard:u'view/update'>
> File "/usr/lib/python2.6/dist-packages/zope/tales/expressions.py", line 217,
> in __call__
>
> return self._eval(econtext)
> File "/usr/lib/python2.6/dist-packages/zope/tales/expressions.py", line 211,
> in _eval
>
> return ob()
> File "/usr/lib/python2.6/dist-packages/schooltool/export/importer.py", line
> 729, in update
>
> imp.import_data(wb)
> File "/usr/lib/python2.6/dist-packages/schooltool/export/importer.py", line
> 108, in import_data
>
> return self.process()
> File "/usr/lib/python2.6/dist-packages/schooltool/export/importer.py", line
> 688, in process
>
> row = self.import_group(sh, row)
> File "/usr/lib/python2.6/dist-packages/schooltool/export/importer.py", line
> 668, in import_group
>
> group = self.createGroup(data)
> File "/usr/lib/python2.6/dist-packages/schooltool/export/importer.py", line
> 643, in createGroup
>
> gc = IGroupContainer(syc[data['school_year']])
> File "/usr/lib/python2.6/dist-packages/zope/container/btree.py", line 88, in
> __getitem__
>
> return self._SampleContainer__data[key]
>
>
Attachment:
StudentImport2010_grade8.xls
Description: MS-Excel spreadsheet