Пример #1
0
class IBankAccount(IPaymentInformation):
    """Stores information of a bank account.
    """
    account_number = schema.TextLine(
        title=_(u'Account Number'),
        description=_(u"Please enter your account number"),
        default=u'',
        required=True,
    )
    
    bank_identification_code = schema.TextLine(
        title=_(u'Bank Information Code'),
        description=_(u"Please enter your bank information code"),
        default=u'',
        required=True,
    )
    
    depositor = schema.TextLine(
        title=_(u'Depositor'),
        description=_(u"Please enter the depositor of the account"),
        default=u'',
        required=True,
    )
    
    bank_name = schema.TextLine(
        title=_(u'Bank Name'),
        description=_(u"Please enter the bank name"),
        default=u'',
        required=True,
    )
Пример #2
0
class IInformationPage(Interface):
    """A page to hold the information as HTML and downloadable file.
    """
    text = schema.Text(
        title=_(u'Text'),
        description=_(u"The information as HTML"),
        default=u'',
        required=False,
    )

    text = schema.Bytes(
        title=_(u'File'),
        description=_(u"The information as downloadable file."),
        required=False,
    )
Пример #3
0
class ICreditCard(IPaymentInformation):
    """Stores information of a credit card.
    """
    card_type = schema.Choice(
        title=_(u"Card Type"),
        description=_(u"Please select the type of the card."),
        vocabulary = schema.vocabulary.SimpleVocabulary.fromItems(
            CREDIT_CARDS_CHOICES.items()))
    
    card_owner = schema.TextLine(
        title=_(u'Card Owner'),
        description=_(u"Please enter the name of the card owner."),
        default=u'',
        required=True,
    )

    card_number = schema.TextLine(
        title=_(u'Card Number'),
        description=_(u"Please enter your the card number."),
        default=u'',
        required=True,
    )

    card_expiration_date_month = schema.Choice(
        title=_(u'Expiration Date Month'),
        description=_(u"Please enter the expiration date of the card."),
        vocabulary = schema.vocabulary.SimpleVocabulary.fromItems(
            CREDIT_CARD_MONTHS_CHOICES),
        default=u"01")

    card_expiration_date_year = schema.Choice(
        title=_(u'Expiration Date Year'),
        description=_(u"Please enter the expiration date of the card."),
        vocabulary = schema.vocabulary.SimpleVocabulary.fromItems(
            CREDIT_CARD_YEARS_CHOICES),
        default=u"2007")
Пример #4
0
class ICustomer(Interface):
    """A customer can buy products from the shop.
    """
    firstname = schema.TextLine(
        title=_(u'Firstname'),
        description=_(u"Please enter your firstname."),
        default=u'',
        required=True,
    )

    lastname = schema.TextLine(
        title=_(u'Lastname'),
        description=_(u"Please enter your lastname."),
        default=u'',
        required=True,
    )

    email = schema.TextLine(
        title=_(u'E-Mail'),
        description=_(u"Please enter your e-mail."),
        default=u'',
        required=True,
    )

    selected_invoice_address = Attribute("The selected invoice address.")
    selected_shipping_address = Attribute("The selected shipping address.")
    selected_payment_method = Attribute("The selected payment method.")
    selected_shipping_method = Attribute("The selected shipping method.")

    selected_country = \
        Attribute("""Country which is used to calculate the shipping price, if
                     the customer has not yet entered a invoice address""")

    selected_payment_method = \
        Attribute("""The payment is processed with this method.""")

    selected_payment_information = \
        Attribute("""Some payment methods need additional information (e.g. 
                     Credit Card)""")
Пример #5
0
class IAddress(Interface):
    """A address of a customer.
    """
    firstname = schema.TextLine(
        title=_(u'Firstname'),
        description=_(u"Please enter your firstname."),
        default=u'',
        required=True,
    )

    lastname = schema.TextLine(
        title=_(u'Lastname'),
        description=_(u"Please enter your lastname."),
        default=u'',
        required=True,
    )

    company_name = schema.TextLine(
        title=_(u'Company Name'),
        description=_(u"Please enter your company name."),
        default=u'',
        required=False,
    )

    address_1 = schema.TextLine(
        title=_(u'Address 1'),
        description=_(u"Please enter your address."),
        default=u'',
        required=True,
    )

    zip_code = schema.TextLine(
        title=_(u'Zip Code'),
        description=_(u"Please enter your zip code."),
        default=u'',
        required=True,
    )

    city = schema.TextLine(
        title=_(u'City'),
        description=_(u"Please enter your city."),
        default=u'',
        required=True,
    )

    country = schema.Choice(title=_(u'Country'),
                            description=_(u"Please enter your country."),
                            vocabulary="easyshop.countries")

    email = schema.TextLine(
        title=_(u'E-Mail'),
        description=_(u"Please enter your e-mail address."),
        default=u'',
        required=True,
    )

    phone = schema.TextLine(
        title=_(u'Phone'),
        description=_(u"Please enter your phone number."),
        default=u'',
        required=False,
    )
Пример #6
0
class IProduct(Interface):
    """Products are sold in the shop.
    """
    description = schema.Text(
        title=_(u"Description"),
        description=_(u"A short description, which is displayed in search results"),
        default=u"",
        required=False,
    )

    articleId = schema.TextLine(
        title=_(u"Article Id"),
        description=_(u"External unique id of the product"),
        default=u"",
        required=False,
    )

    shortTitle = schema.TextLine(
        title=_(u"Short Title"),
        description=_(u"Short title of the product, which can be displayed in overviews"),
        default=u"",
        required=False,
    )
        
    shortText = schema.TextLine(
        title=_(u"Short Text"),
        description=_(u"A short text of the product, which can be displayed in overviews"),
        default=u"",
        required=False,
    )

    text = schema.TextLine(
        title=_(u"Text"),
        description=_(u"A text of the product, which is displayed in detailed views"),
        default=u"",
        required=False,
    )

    # image = schema.Object(
    #     title=_(u"Text"),
    #     schema = IImage,
    #     description=_(u"The main image of the product"),
    #     required=False,
    # )
    # 
    unlimitedAmount = schema.Bool(
        title=_(u"Unlimited Amount"),
        description=_(u"If selected, the stock amount of the product is not decreased."),
        default=False,
        required=False,
    )

    stockAmount = schema.Float(
        title=_(u"Stock Amount"),
        description=_(u"The amount of this product in stock. This number is decreased automatically when the product has been sold."),
        default=0.0,
        required=False,
    )

    weight = schema.Float(
        title=_(u"Weight"),
        description=_(u"The weight of the product."),
        default=0.0,
        required=False,
    )

    price = schema.Float(
        title=_(u"Price"),
        description=_(u"The price of the product."),
        default=0.0,
        required=False,
    )
    
    forSale = schema.Bool(
        title=_(u"For Sale"),
        description=_(u"If selected the sale price is active and displayed additionally."),
        default=False,
        required=False,
    )
    
    salePrice = schema.Float(
        title=_(u"Sale Price"),
        description=_(u"The sale price of the product."),
        default=0.0,
        required=False,
    )