Add minimalistic Date definition for schema editor
This commit is contained in:
parent
45a577d394
commit
c33b16adf5
|
@ -1,5 +1,5 @@
|
|||
from zope.interface import implements
|
||||
from zope.schema import Choice, Field, List
|
||||
from zope.schema import Choice, Field, List, Date
|
||||
|
||||
from zope.schema.interfaces import IFromUnicode
|
||||
from zope.schema.interfaces import WrongType
|
||||
|
|
|
@ -4,6 +4,7 @@ from themisfields import interfaces
|
|||
from themisfields import Commission
|
||||
from themisfields import Author
|
||||
from themisfields import Authors
|
||||
from themisfields import Date
|
||||
from plone.schemaeditor.fields import FieldFactory
|
||||
|
||||
class ICommission(interfaces.ICommission, schema_ifaces.IFromUnicode):
|
||||
|
@ -22,3 +23,5 @@ class IAuthors(interfaces.IAuthors, schema_ifaces.IList):
|
|||
pass
|
||||
|
||||
AuthorsFactory = FieldFactory(Authors, u'Author(s)')
|
||||
|
||||
DateFactory = FieldFactory(Date, u'Date')
|
||||
|
|
|
@ -17,4 +17,9 @@
|
|||
component=".editors.AuthorsFactory"
|
||||
/>
|
||||
|
||||
<utility
|
||||
name="themisfields.Date"
|
||||
component=".editors.DateFactory"
|
||||
/>
|
||||
|
||||
</configure>
|
||||
|
|
|
@ -12,13 +12,9 @@ if HAVE_SUPERMODEL:
|
|||
from plone.supermodel.interfaces import IToUnicode
|
||||
|
||||
from themisfields import Commission
|
||||
from themisfields.interfaces import ICommission
|
||||
|
||||
from themisfields import Author
|
||||
from themisfields.interfaces import IAuthor
|
||||
|
||||
from themisfields import Authors
|
||||
from themisfields.interfaces import IAuthors
|
||||
from themisfields import Date
|
||||
|
||||
class CommissionHandler_(BaseHandler):
|
||||
pass
|
||||
|
@ -34,3 +30,8 @@ if HAVE_SUPERMODEL:
|
|||
pass
|
||||
|
||||
AuthorsHandler = AuthorsHandler_(Authors)
|
||||
|
||||
class DateHandler_(BaseHandler):
|
||||
pass
|
||||
|
||||
DateHandler = DateHandler_(Date)
|
||||
|
|
|
@ -19,4 +19,9 @@
|
|||
name="themisfields.Authors"
|
||||
/>
|
||||
|
||||
<utility
|
||||
component=".handlers.DateHandler"
|
||||
name="themisfields.Date"
|
||||
/>
|
||||
|
||||
</configure>
|
||||
|
|
Reference in New Issue