# -*- coding: utf-8 -*-
{{% if not dexterity_type_supermodel %}}
# from plone.app.textfield import RichText
# from plone.autoform import directives
{{% endif %}}
{{% if dexterity_type_base_class == 'Container' %}}
from plone.dexterity.content import Container
{{% endif %}}
{{% if dexterity_type_base_class == 'Item' %}}
from plone.dexterity.content import Item
{{% endif %}}
{{% if not dexterity_type_supermodel %}}
# from plone.namedfile import field as namedfile
{{% endif %}}
from plone.supermodel import model
{{% if not dexterity_type_supermodel %}}
# from plone.supermodel.directives import fieldset
# from z3c.form.browser.radio import RadioFieldWidget
# from zope import schema
{{% endif %}}
{{% if dexterity_type_create_class %}}
from zope.interface import implementer
{{% endif %}}


{{% if not dexterity_type_supermodel %}}
# from {{{package.dottedname}}} import _


{{% endif %}}
class I{{{ dexterity_type_name_klass }}}(model.Schema):
{{% if dexterity_type_supermodel %}}
    """ Marker interface for {{{ dexterity_type_name_klass }}}
    """
{{% else %}}
    """ Marker interface and Dexterity Python Schema for {{{ dexterity_type_name_klass }}}
    """
    # If you want, you can load a xml model created TTW here
    # and customize it in Python:

    # model.load('{{{ dexterity_type_name_normalized }}}.xml')

    # directives.widget(level=RadioFieldWidget)
    # level = schema.Choice(
    #     title=_(u'Sponsoring Level'),
    #     vocabulary=LevelVocabulary,
    #     required=True
    # )

    # text = RichText(
    #     title=_(u'Text'),
    #     required=False
    # )

    # url = schema.URI(
    #     title=_(u'Link'),
    #     required=False
    # )

    # fieldset('Images', fields=['logo', 'advertisement'])
    # logo = namedfile.NamedBlobImage(
    #     title=_(u'Logo'),
    #     required=False,
    # )

    # advertisement = namedfile.NamedBlobImage(
    #     title=_(u'Advertisement (Gold-sponsors and above)'),
    #     required=False,
    # )

    # directives.read_permission(notes='cmf.ManagePortal')
    # directives.write_permission(notes='cmf.ManagePortal')
    # notes = RichText(
    #     title=_(u'Secret Notes (only for site-admins)'),
    #     required=False
    # )
{{% endif %}}
{{% if dexterity_type_create_class %}}


@implementer(I{{{ dexterity_type_name_klass }}})
class {{{ dexterity_type_name_klass }}}({{{ dexterity_type_base_class }}}):
    """ Content-type class for I{{{ dexterity_type_name_klass }}}
    """
{{% endif %}}
