Last change
on this file since 7665 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 | |
---|
1 | reg_number,matric_number,level,code,score,mandatory |
---|
2 | 1,,100,COURSE1,1,True |
---|
3 | 2,,100,COURSE1,2,False |
---|
4 | ,100002,100,COURSE1,3,False |
---|
5 | 1,,nonsense,COURSE1,5, |
---|
6 | 1,,100,NONSENSE,5, |
---|
Note: See
TracBrowser for help on using the repository browser.