source: main/waeup.sirp/trunk/src/waeup/sirp/students/tests/sample_courseticket_data.csv @ 7754

Last change on this file since 7754 was 7665, checked in by Henrik Bettermann, 13 years ago

Rename attribute core_or_elective to mandatory.

The following commands in debug mode will fix existing databases:

from zope.component import getUtility
from zope.catalog.interfaces import ICatalog
from zope.intid.interfaces import IIntIds
import transaction
sm = rootfutminna?.getSiteManager()
cat = sm.getUtility(ICatalog, name='certcourses_catalog')
cat.values()[0].documentCount()
results = cat.apply({'course_code':(None,None)})
uidutil = getUtility(IIntIds, context=cat)
for r in results:

... o = uidutil.getObject(r)
... o.mandatory = o.core_or_elective
...

cat = sm.getUtility(ICatalog, name='coursetickets_catalog')
cat.values()[0].documentCount()
results = cat.apply({'code':(None,None)})
uidutil = getUtility(IIntIds, context=cat)
for r in results:

... o = uidutil.getObject(r)
... o.mandatory = o.core_or_elective
...

transaction.commit()

File size: 167 bytes
Line 
1reg_number,matric_number,level,code,score,mandatory
21,,100,COURSE1,1,True
32,,100,COURSE1,2,False
4,100002,100,COURSE1,3,False
51,,nonsense,COURSE1,5,
61,,100,NONSENSE,5,
Note: See TracBrowser for help on using the repository browser.