Deform Date widget does not show up /JS Deform Date callback fails because of Modernizr

181 views Asked by At

I have no idea whether both issues are related or not in any way, since I don't know much about Modernizr.

The widget is associated to the date field through ColanderAlchemy, in the SqlAlchemy mapping of the model:

class Model(Base):
    ...
    date = Column(Date, nullable=True, default=None, 
                    info={'colanderalchemy': { 'widget': deform.widget.DateInputWidget(), }} )

it is mapped as a colander.Date into the schema:

sch = SQLAlchemySchemaNode(Model)
sch.children[n]
<colander.SchemaNode object at 121775952 (named date)>
sch.children[n].typ
<colander.Date at 0x74226d0>

But the Datepicker widget is not displayed while entering the input field.

And when submitting the form, the js script related to this Deform date field fails with

ReferenceError: Modernizr is not defined

Any help ?

1

There are 1 answers

1
Foreign Object On

Without knowing more, I'm going to guess that Deform Date Widget has Modernizr as a dependency, something like if(!Modernizr.touch){}

I would include Modernizr, or investigate the source and look for references to Modernizr— see if that remedies your issue.