leforestier / yattag

Python library to generate HTML or XML in a readable, concise and pythonic way.
333 stars 31 forks source link

Enabling support for file type in input field. #42

Closed piyush-multiplexer closed 4 years ago

piyush-multiplexer commented 6 years ago

file is missing from following types in input fields in original code, so it throws error

yattag.simpledoc.DocError: Unknown input type: file

def input(self, *args, **kwargs):
    "required attributes: 'name' and 'type'"
    name, type, attrs = _attrs_from_args(('name', 'type'), *args, **kwargs)
    self._fields.add(name)
    if type in (
        'text', 'password', 'hidden', 'search', 'email', 'url', 'number',
        'range', 'date', 'datetime', 'datetime-local', 'month', 'week',
        'time', 'color', 'file'
    ):
leforestier commented 4 years ago

Issue finally settled thanks to https://github.com/leforestier/yattag/pull/63