Changeset 5012 for main/waeup.sirp/trunk/src/waeup/sirp
- Timestamp:
- 4 Feb 2010, 17:28:28 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/utils/converters.txt
r5005 r5012 663 663 token value of a term. 664 664 665 Using the ;meth:`toString()`will deliver the token for us:665 Using the :meth:`toString()` method will deliver the token for us: 666 666 667 667 >>> converter.toString(1) 668 668 '1' 669 669 670 >>> from waeup.sirp.university.interfaces import ICourse 671 >>> from zope.schema import getFields 672 >>> field = getFields(ICourse)['semester'] 670 >>> from waeup.sirp.interfaces import SimpleWAeUPVocabulary 671 >>> field = Choice( 672 ... title = u'Favourite Dish', 673 ... default = 0, 674 ... vocabulary = SimpleWAeUPVocabulary( 675 ... ('N/A', 0), ('Pizza', 1), 676 ... ('Cake', 2), ('Muffins', 3)), 677 ... required = True, 678 ... ) 673 679 674 680 >>> converter = ISchemaTypeConverter(field)
Note: See TracChangeset for help on using the changeset viewer.