rename 'float' field to 'decimal'
This commit is contained in:
parent
8a77fec13d
commit
784ca70365
4 changed files with 7 additions and 9 deletions
|
@ -49,8 +49,8 @@ Field types
|
|||
|
||||
>>> from cybertools.composer.schema.interfaces import fieldTypes
|
||||
>>> sorted(t.token for t in fieldTypes)
|
||||
['checkbox', 'checkboxes', 'date', 'display', 'dropdown', 'email',
|
||||
'explanation', 'fileupload', 'float', 'heading', 'html', 'list', 'number',
|
||||
['checkbox', 'checkboxes', 'date', 'decimal', 'display', 'dropdown',
|
||||
'email', 'explanation', 'fileupload', 'heading', 'html', 'list', 'number',
|
||||
'password', 'radiobuttons', 'spacer', 'textarea', 'textline']
|
||||
|
||||
>>> from zope.schema.vocabulary import SimpleVocabulary
|
||||
|
|
|
@ -18,8 +18,6 @@
|
|||
|
||||
"""
|
||||
Schema factory stuff.
|
||||
|
||||
$Id$
|
||||
"""
|
||||
|
||||
from zope.component import adapts
|
||||
|
@ -41,7 +39,7 @@ class Email(schema.TextLine):
|
|||
schema.Field.__typeInfo__ = ('textline',)
|
||||
schema.Password.__typeInfo__ = ('password',)
|
||||
schema.Int.__typeInfo__ = ('number',)
|
||||
schema.Float.__typeInfo__ = ('float',)
|
||||
schema.Float.__typeInfo__ = ('decimal',)
|
||||
schema.Choice.__typeInfo__ = ('dropdown',)
|
||||
|
||||
|
||||
|
@ -62,7 +60,7 @@ class SchemaFactory(object):
|
|||
schema.Date: ('date',),
|
||||
schema.Datetime: ('date',),
|
||||
#schema.Int: ('number',),
|
||||
#schema.Float: ('float',),
|
||||
#schema.Float: ('decimal',),
|
||||
schema.Bool: ('checkbox',),
|
||||
schema.List: ('list',),
|
||||
#schema.Choice: ('dropdown',),
|
||||
|
|
|
@ -263,7 +263,7 @@ class NumberFieldInstance(FieldInstance):
|
|||
self.setError('invalid_number')
|
||||
|
||||
|
||||
class FloatFieldInstance(NumberFieldInstance):
|
||||
class DecimalFieldInstance(NumberFieldInstance):
|
||||
|
||||
format = 'decimal'
|
||||
|
||||
|
|
|
@ -98,8 +98,8 @@ fieldTypes = SimpleVocabulary((
|
|||
FieldType('html', 'html', u'HTML Text'),
|
||||
FieldType('number', 'number', u'Number',
|
||||
inputRenderer='input_textline', instanceName='number'),
|
||||
FieldType('float', 'float', u'Float',
|
||||
inputRenderer='input_textline', instanceName='float'),
|
||||
FieldType('decimal', 'decimal', u'Decimal',
|
||||
inputRenderer='input_textline', instanceName='decimal'),
|
||||
FieldType('date', 'date', u'Date', instanceName='date'),
|
||||
FieldType('email', 'email', u'E-Mail Address',
|
||||
displayRenderer='display_email', inputRenderer='input_textline',
|
||||
|
|
Loading…
Add table
Reference in a new issue