add_type (type)

This registers a new Field Type with the environment

Example

from lektor.types import Type

class MyThingType(Type):
    widget = 'singleline-text'

    def value_from_raw(self, raw):
        return raw.value

def setup_env(self, **extra):
    self.env.add_type(MyThingType)

Comments