Ignore:
Timestamp:
17 Feb 2012, 12:06:10 (13 years ago)
Author:
Henrik Bettermann
Message:

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:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studylevelmanagepage.pt

    r7663 r7665  
    7373          <td tal:content="value/fcode">FACULTY</td>
    7474          <td tal:content="value/credits">CREDITS</td>
    75           <td tal:content="value/core_or_elective">MANDATORY</td>
     75          <td tal:content="value/mandatory">MANDATORY</td>
    7676          <td tal:content="value/score">SCORE</td>
    7777          <td tal:content="value/carry_over">CO</td>
Note: See TracChangeset for help on using the changeset viewer.