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