# Path: lektor/types/primitives.py
# class SingleInputType(Type):
# 
#     def to_json(self, pad, record=None, alt=PRIMARY_ALT):
#         rv = Type.to_json(self, pad, record, alt)
#         rv['addon_label_i18n'] = get_i18n_block(
#             self.options, 'addon_label') or None
#         return rv


from lektor.utils import slugify, Url
from lektor.types.primitives import SingleInputType


class SortKeyType(SingleInputType):

    def value_from_raw(self, raw):
        if raw.value is None:
            return raw.missing_value('Missing sort key')
        try:
            return int(raw.value.strip())
        except ValueError:
            return raw.bad_value('Bad sort key value')



# Path: lektor/types/primitives.py
# class SingleInputType(Type):
# 
#     def to_json(self, pad, record=None, alt=PRIMARY_ALT):
#         rv = Type.to_json(self, pad, record, alt)
#         rv['addon_label_i18n'] = get_i18n_block(
#             self.options, 'addon_label') or None
#         return rv


# Path: lektor/types/special.py
from lektor.utils import slugify, Url
from lektor.types.primitives import SingleInputType



class SortKeyType(SingleInputType):

    def value_from_raw(self, raw):
        if raw.value is None:
            return raw.missing_value('Missing sort key')
        try:
            return int(raw.value.strip())
        except ValueError:
            return raw.bad_value('Bad sort key value')



class SlugType(SingleInputType):