Ejemplo n.º 1
0
class RatingTypeSubstitution(Base):
    adapts(ITorneo)

    category = _(u'Torneo')
    description = _(u'Rating type')

    def safe_call(self):
        return self.context.rating_type
Ejemplo n.º 2
0
class CitySubstitution(Base):
    adapts(ITorneo)

    category = _(u'Torneo')
    description = _(u'City')

    def safe_call(self):
        return self.context.city
Ejemplo n.º 3
0
class CASubstitution(Base):
    adapts(ITorneo)

    category = _(u'Torneo')
    description = _(u'Chief arbiter')

    def safe_call(self):
        return self.context.chief_arbiter
Ejemplo n.º 4
0
class SystemSubstitution(Base):
    adapts(ITorneo)

    category = _(u'Torneo')
    description = _(u'System of play')

    def safe_call(self):
        return self.context.system
Ejemplo n.º 5
0
class DateEndSubstitution(DateSubstitution):
    adapts(ITorneo)

    category = _(u'Torneo')
    description = _(u'End date of the tournament')

    def safe_call(self):
        return self.formatDate(self.context.end_date)
Ejemplo n.º 6
0
from plone.namedfile.interfaces import IImageScaleTraversable
from plone.supermodel import model
from Products.Five import BrowserView
from zope.interface import implements
from zope.schema import Choice
from zope.schema import Int
from zope.schema import Date
from zope.schema import List
from zope.schema import TextLine
from zope.schema.vocabulary import SimpleTerm
from zope.schema.vocabulary import SimpleVocabulary

from feda.torneos import MessageFactory as _

tournament_systems = SimpleVocabulary(
    [SimpleTerm(value=u'IS', title=_(u'Individual Swiss')),
     SimpleTerm(value=u'IRR', title=_(u'Individual Round Robin')),
     SimpleTerm(value=u'IDRR', title=_(u'Individual Double Round Robin')),
     SimpleTerm(value=u'TS', title=_(u'Team Swiss')),
     SimpleTerm(value=u'TRR', title=_(u'Team Round Robin')),
     SimpleTerm(value=u'O', title=_(u'Other (explain in comments)'))


     ]
    )

rating_types = SimpleVocabulary(
    [SimpleTerm(value=u'standard', title=_(u'Standard chess')),
     SimpleTerm(value=u'rapid', title=_(u'Rapid chess')),
     SimpleTerm(value=u'blitz', title=_(u'Blitz chess')),
Ejemplo n.º 7
0
class ITorneo(model.Schema, IImageScaleTraversable):
    """
    Description of the Example Type
    """
    # If you want a schema-defined interface, delete the form.model
    # line below and delete the matching file in the models sub-directory.
    # If you want a model-based interface, edit
    # models/torneo.xml to define the content type
    # and add directives here as necessary.

    city = TextLine(
        title=_(u'City'),
        required=True,
    )

    number_of_players = Int(
        title=_(u'Number of expected players'),
        required=True,
    )

    system = Choice(
        title=_(u'System of play'),
        vocabulary=tournament_systems,
        required=True,
    )

    start_date = Date(
        title=_(u'Start date'),
        required=True,
    )

    end_date = Date(
        title=_(u'End date'),
        required=True,
    )

    chief_arbiter = Int(
        title=_(u'Chief arbiter'),
        description=_("Enter arbiter's FIDE ID"),
        required=True,
    )

    deputy_arbiters = List(
        title=_(u'Deputy arbiters'),
        value_type=Int(title=_(u'Deputy arbiter')),
        required=False,
    )

    organizer_id = Int(
        title=_(u"Organizer's FIDE ID"),
        description=_("Enter only if the organizer has a FIDE ID"),
        required=False,
    )

    organizer_name = TextLine(
        title=_(u"Organizer's Name"),
        description=_("Enter only if the organizer does not have a FIDE ID"),
        required=False,
    )

    rating_type = Choice(
        title=_(u'Rating type'),
        vocabulary=rating_types,
        required=True,
    )

    invoice_name = TextLine(title=_(u'Name for the invoice'), required=True)

    invoice_nif_cif = TextLine(title=_(u'NIF/CIF'), required=True)

    invoice_address = TextLine(title=_(u'Address for the invoice'),
                               required=True)

    invoice_city = TextLine(title=_(u'City'), required=True)

    invoice_postal_code = TextLine(title=_(u'Postal code'), required=True)
Ejemplo n.º 8
0
from plone.namedfile.interfaces import IImageScaleTraversable
from plone.supermodel import model
from Products.Five import BrowserView
from zope.interface import implements
from zope.schema import Choice
from zope.schema import Int
from zope.schema import Date
from zope.schema import List
from zope.schema import TextLine
from zope.schema.vocabulary import SimpleTerm
from zope.schema.vocabulary import SimpleVocabulary

from feda.torneos import MessageFactory as _

tournament_systems = SimpleVocabulary([
    SimpleTerm(value=u'IS', title=_(u'Individual Swiss')),
    SimpleTerm(value=u'IRR', title=_(u'Individual Round Robin')),
    SimpleTerm(value=u'IDRR', title=_(u'Individual Double Round Robin')),
    SimpleTerm(value=u'TS', title=_(u'Team Swiss')),
    SimpleTerm(value=u'TRR', title=_(u'Team Round Robin')),
    SimpleTerm(value=u'O', title=_(u'Other (explain in comments)'))
])

rating_types = SimpleVocabulary([
    SimpleTerm(value=u'standard', title=_(u'Standard chess')),
    SimpleTerm(value=u'rapid', title=_(u'Rapid chess')),
    SimpleTerm(value=u'blitz', title=_(u'Blitz chess')),
])


# Interface class; used to define content-type schema.