Ejemplo n.º 1
0
class TicketPrintData(Model):
    ticketNumber = fields.IntegerField()
    ticketRequest = related.OneOf(TicketRequest)
    movieDate = fields.DateTimeField()
    movieTitle = fields.CharField()
    code = fields.CharField()
    qrCode = fields.CharField()
Ejemplo n.º 2
0
class TicketRequest(Model):
    movieDateId = fields.IntegerField()
    terms = fields.BooleanField(default=False)
    email = fields.CharField()
    emailVerification = fields.CharField()
    paymentTypes = related.ListOf(str)
    nrOfSeats = fields.IntegerField()
Ejemplo n.º 3
0
class MailBatchItem(Document):
    mail = related.OneOf(BaseMail)
    preferredSendTime = fields.DateTimeField(null=True)
    userId = fields.CharField(max_length=64, null=True)
    unsubscribeUrl = fields.CharField(max_length=256, null=True)

    mailTo = fields.CharField(null=False,
                              blank=False,
                              verbose_name={"nl": "Email afzender"},
                              js_validate_regex=JS_EMAIL_VALIDATION_REGEX)
Ejemplo n.º 4
0
class TicketAvailability(Model):
    movieDateId = fields.IntegerField()
    movieTitle = fields.CharField()
    movieDate = fields.DateTimeField()
    isPassed = fields.BooleanField()
    nrOfSingleSeatsTicketsAvailable = fields.IntegerField()
    nrOfDoubleSeatsTicketsAvailable = fields.IntegerField()
Ejemplo n.º 5
0
class FileReference(DataAspect):
    href = fields.CharField(blank=True)
    fileName = fields.CharField(blank=True)

    @property
    def file_path(self):
        p = parse(self.href)
        path = p.path

        media_url = settings.MEDIA_URL
        media_root = settings.MEDIA_ROOT + "/"

        file_path = path.replace(media_url, media_root)
        return file_path

    @property
    def extention(self):
        try:
            return os.path.splitext(self.fileName)[1]
        except:
            return ""
Ejemplo n.º 6
0
class Mail(BaseMail):
    subject = fields.CharField(verbose_name={"nl": "Onderwerp"})
    mailText = fields.TextField(verbose_name={"nl": "Inhoud"})
    htmlText = fields.TextField(verbose_name={"nl": "Html Inhoud"},
                                null=True,
                                blank=True)
    # emailSender = fields.CharField(
    #     null=False,
    #     blank=False,
    #     verbose_name={"nl": "Email afzender"},
    #     js_validate_regex=JS_EMAIL_VALIDATION_REGEX)
    attachments = related.ListOf(FileReference,
                                 blank=True,
                                 null=True,
                                 verbose_name={"nl": "Bijlages"})

    def get_subject(self):
        return self.subject

    def get_text(self):
        return self.mailText

    def get_html(self):
        return self.htmlText

    # def get_from_email(self):
    #     return self.emailSender
    #
    # def get_reply_to_email(self):
    #     return self.emailSender

    def get_attachments(self):
        result = []
        if self.attachments:
            for attachment in self.attachments:
                result.append(attachment.file_path)
        return result
Ejemplo n.º 7
0
class TemplateMail(BaseMail):

    mailData = related.OneOf(Document)
    attachments = related.ListOf(FileReference,
                                 blank=True,
                                 null=True,
                                 verbose_name={"nl": "Bijlages"})
    emailSender = fields.CharField(null=False,
                                   blank=False,
                                   verbose_name={"nl": "Email afzender"},
                                   js_validate_regex=JS_EMAIL_VALIDATION_REGEX)

    def set_shared_template(self, shared_template):
        self.shared_template = shared_template

    def get_subject(self):
        return self.shared_template.render_subject(self.mailData)

    def get_text(self):
        return self.shared_template.render_txt(self.mailData)

    def get_html(self):
        return self.shared_template.render_html(self.mailData)

    def get_from_email(self):
        return self.emailSender

    def get_reply_to_email(self):
        return self.emailSender

    def get_attachments(self):
        result = []
        if self.attachments:
            for attachment in self.attachments:
                result.append(attachment.file_path)
        return result
Ejemplo n.º 8
0
class MailConfirmation(Model):
    confirmationId = fields.CharField()
    movieTitle = fields.CharField()
    movieDate = fields.DateTimeField()
    confirmationStatus = fields.CharField()  # open, time_out, confirmed
Ejemplo n.º 9
0
class TicketResponse(Model):
    ticketId = fields.CharField(null=True, blank=True)
    available = fields.BooleanField()
    redirectUrl = fields.CharField(max_length=1024, null=True, blank=True)
    verificationBy = fields.CharField(max_length=1024, null=True,
                                      blank=True)  # payment, email
Ejemplo n.º 10
0
class TicketStatus(Model):
    ticketRequest = related.OneOf(TicketRequest)
    status = fields.CharField()
    ticketSendStatus = fields.CharField()
    movieTitle = fields.CharField()
    movieDate = fields.DateTimeField()