Beispiel #1
0
class Customer(AbstractBaseUser):
    object = UserManager()

    role = models.CharField(max_length=50, choices=Roles, default='customer')
    username = models.CharField(max_length=50, unique=True)
    cust_first_name = models.CharField(max_length=50)
    cust_last_name = models.CharField(max_length=50)
    cust_email = models.EmailField(max_length=100, null=False, blank=False)
    address = models.CharField(max_length=200)
    city = models.CharField(max_length=50)
    state = models.CharField(max_length=50)
    zipcode = models.CharField(max_length=10)
    phone_number = models.CharField(max_length=50)
    cust_bill_card = CardNumberField('card number')
    cust_bill_expiry = CardExpiryField('expiration date')
    cust_bill_code = SecurityCodeField('security code')
    created_date = models.DateTimeField(default=timezone.now)
    updated_date = models.DateTimeField(auto_now_add=True)

    USERNAME_FIELD = "username"

    def created(self):
        self.created_date = timezone.now()
        self.save()

    def updated(self):
        self.updated_date = timezone.now()
        self.save()

    def __str__(self):
        return str(self.cust_email)
Beispiel #2
0
class BookSeat(models.Model):
    id = models.AutoField(primary_key=True)
    seat = models.OneToOneField(Seat, on_delete=models.CASCADE, unique=True)
    booking_price = MoneyField(default=0,
                               default_currency='INR',
                               max_digits=11,
                               null=True,
                               blank=True)
    name_on_card = models.CharField(max_length=150)
    cc_number = CardNumberField('card number')
    cc_expiry = CardExpiryField('expiration date')
    cc_code = SecurityCodeField('security code')
    created_at = models.DateTimeField(auto_now=True)
    updated_at = models.DateTimeField(auto_now_add=True)
    user = models.ForeignKey("user.User",
                             on_delete=models.CASCADE,
                             null=True,
                             blank=True)

    def __str__(self):
        return "{}-{}".format(self.seat, self.user)

    def send_mail(self, user, email, movie, date):
        subject = "Seat Booked"
        message = "Hello {}, you have book movie {}, on date {}.".format(
            user, movie, date)
        try:
            send_mail(subject, message, email, [email])
        except Exception as e:
            print(e)
Beispiel #3
0
class PaymentMethod(models.Model):
    user      = models.ForeignKey('User', on_delete=models.CASCADE)
    cc_number = CardNumberField('card number')
    cc_expiry = CardExpiryField('expiration date')

    class Meta:
        db_table = 'paymentmethods'
Beispiel #4
0
class CreditCard(models.Model):
    # first parameter: actual value to be set on the model
    # second parameter: human readable name
    cc_type = models.CharField(max_length=256, verbose_name="Credit Card Type", choices=[("Master", "Master"), ("Visa", "Visa")], default="Master")
    cc_number = CardNumberField(_('card number'))
    cc_expiry = CardExpiryField(_('expiration date'))
    cc_code = SecurityCodeField(_('security code'))
Beispiel #5
0
class cards_info(models.Model):
    card_info_id = models.UUIDField(primary_key=True,
                                    default=uuid.uuid4,
                                    editable=False)
    name_on_card = models.CharField(max_length=50, blank=False)
    cc_number = CardNumberField(help_text='card number')
    cc_expiry = CardExpiryField(help_text='expiration date')
    cc_code = SecurityCodeField(help_text='security code')
Beispiel #6
0
class Payment(models.Model):
    user = models.ForeignKey(get_user_model(), on_delete=models.CASCADE)

    card_number = CardNumberField(_("card number"))
    card_expiry = CardExpiryField(_("expiration date"))
    card_code = SecurityCodeField(_("security code"))

    def __str__(self):
        return "{}'s payment({})".format(self.user.username, str(self.card_number)[-4:])
Beispiel #7
0
class Payment(models.Model):
    CardholderName = models.CharField(
        max_length=100,
        null=True,
    )
    cc_number = CardNumberField('card number')
    cc_code = SecurityCodeField('security code')
    Expiration_Date = models.CharField(max_length=100, null=True, blank=True)
    Year = models.IntegerField(max_length=100, null=True, blank=True)
Beispiel #8
0
class CreditCard(models.Model):
    customer = models.OneToOneField(Customer, on_delete=models.CASCADE)
    cc_name = models.CharField(max_length=50)
    cc_number = CardNumberField('card number')
    cc_expiry = CardExpiryField('expiration date')
    cc_code = SecurityCodeField('security code')

    def __str__(self):
        return f'Card: {self.cc_number}'
Beispiel #9
0
class PaymentInformation(models.Model):
    """ A model class to represent Payment Information from DB """
    first_name = models.CharField(max_length=255)
    last_name = models.CharField(max_length=255)
    card_number = CardNumberField()
    expiration_date = CardExpiryField()
    cvv = SecurityCodeField()

    def __str__(self):
        return self.first_name + " " + self.last_name
Beispiel #10
0
class Payment(models.Model):
    patient_user = models.ForeignKey(User,
                                     on_delete=models.SET_NULL,
                                     null=True,
                                     blank=True)
    cc_number = CardNumberField('card number')
    cc_expiry = CardExpiryField('expiration date')
    cc_code = SecurityCodeField('security code')

    def __str__(self):
        return f"Credit card for {self.patient_user}"
Beispiel #11
0
class PaymentInfo(models.Model):  # þetta 3 party dummy
    card_holder = models.CharField(max_length=255)
    cc_number = CardNumberField()
    cc_expiry = CardExpiryField()
    cc_code = SecurityCodeField()
    user = models.ForeignKey(User,
                             on_delete=models.CASCADE,
                             default=None,
                             blank=True,
                             null=True)
    archived = models.BooleanField(default=False)
Beispiel #12
0
class Billing(models.Model):
    first_name = models.CharField(max_length=255)
    last_name = models.CharField(max_length=255)
    street = models.TextField()
    city = models.TextField()
    state = models.TextField()
    zipcode = models.TextField()
    cc_number = CardNumberField()
    cc_expiry = CardExpiryField()
    cc_code = SecurityCodeField()
    user = models.ForeignKey(User, related_name="billing_info", on_delete = models.CASCADE)
class Account(models.Model):
    card_number = CardNumberField(null=True)
    cvc = SecurityCodeField(null=True)
    expiry = CardExpiryField(null=True)
    brand = models.CharField(max_length=10, blank=True)
    last4 = models.CharField(max_length=5, blank=True)
    customer_id = models.CharField(max_length=70, blank=True)
    stripe_id = models.CharField(max_length=50, blank=True)
    token = models.CharField(max_length=100, blank=True)

    def __str__(self):
        return f"{self.customer_id}"
Beispiel #14
0
class CreditCard(models.Model):
    created_by = models.ForeignKey(User, on_delete=models.SET_NULL, null=True)

    cc_number = CardNumberField('card number')
    cc_expiry = CardExpiryField('expiration date')
    cc_code = SecurityCodeField('security code')

    def get_absolute_url(self):
        """Returns the url to access a particular item instance."""
        return reverse('card-detail', args=[str(self.id)])

    def __str__(self):
        """String for representing the Model object."""
        return self.cc_number
class PaymentOption(models.Model):

    id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
    name = models.CharField(max_length=255)
    # user_id = models.ForeignKey(User, on_delete=models.CASCADE)
    cc_number = CardNumberField(_('card number'))
    cc_expiry = CardExpiryField(_('expiration date'))
    cc_code = SecurityCodeField(_('security code'))
    created_at=models.DateTimeField(auto_now_add=True)
    updated_at=models.DateTimeField(auto_now_add=True)
    insertedby = models.ForeignKey(User,related_name="+", on_delete=models.CASCADE)

    def __str__(self):

        return str(self.insertedby)
Beispiel #16
0
class Information(models.Model):
    first_name = models.CharField(max_length=100)
    last_name = models.CharField(max_length=100)
    email = models.EmailField()
    address1 = models.CharField(max_length=100)
    address2 = models.CharField(max_length=100, blank=True, null=True)
    city = models.CharField(max_length=100)
    country = CountryField(multiple=False)
    zip = models.CharField(max_length=100)
    phone = models.CharField(max_length=100)
    cc_number = CardNumberField(('card number'))
    cc_expiry = CardExpiryField(('expiration date'))
    cc_code = SecurityCodeField(('security code'))

    def __str__(self):
        return "{} - {}".format(self.first_name, self.last_name)
Beispiel #17
0
class CreditCardsUsed(models.Model):
    number = CardNumberField('numero')
    date_expiration= CardExpiryField('fecha de vencimiento')
    cod = SecurityCodeField('codigo de seguridad')
    card_name = models.CharField("nombre de tarjeta",max_length=50)
    bank = models.CharField(('banco'),max_length=50)

    def publish(self):
        self.save()

    def __str__(self):
        return str(self.number)

    class Meta:
        verbose_name = "Tarjeta Usada"
        verbose_name_plural = "Tarjetas Usadas"
Beispiel #18
0
class Customer(models.Model):
    user = models.OneToOneField(User, on_delete=models.CASCADE)
    first_name = models.CharField(max_length=200)
    last_name = models.CharField(max_length=200)
    email_id = models.EmailField(max_length=200)
    driver_license_state = models.CharField(max_length=10)
    driving_license_no = models.CharField(max_length=200)
    date_of_birth = models.DateField()
    residence_address = models.CharField(max_length=500)
    cc_holder_name = models.CharField(max_length=200)
    cc_number = CardNumberField(_('Card Number'))
    cc_expiry = CardExpiryField(_('Expiration Date'))
    cc_code = SecurityCodeField(_('Security Code'))

    def __str__(self):
        return self.first_name + self.last_name
Beispiel #19
0
class Pizzeria(ActiveSwitchable, TenantMixin):
    """
    Modelo que representa las pizzerias como Tenants, hereda de TenantMixin
    """
    name = models.CharField(max_length=100,
                            verbose_name=_("Nombre de la pizzeria"))
    address = models.CharField(max_length=100,
                               verbose_name=_("Dirección de la pizzeria"))
    plan = models.ForeignKey(Plan,
                             on_delete=models.CASCADE,
                             null=True,
                             blank=True)
    #department = models.ForeignKey('core.Department', verbose_name=_("Departamento"))
    #city = ChainedForeignKey(City, chained_field='department', chained_model_field='department', show_all=False,verbose_name=_("Ciudad"))
    phones = models.CharField(max_length=100,
                              verbose_name=_("Teléfono(s) de la pizzeria"))
    email = models.EmailField(
        verbose_name=_("Correo electrónico principal de la pizzeria"),
        help_text=_("Puede ser el correo del notario"))
    logo = models.ImageField(upload_to="pizzeria_logos/",
                             blank=True,
                             null=True,
                             verbose_name=_("Logo de la pizzeria"))
    #subdomain = models.CharField(max_length=50, unique=True, verbose_name=_("Subdominio"))

    requested_to_retire = models.BooleanField(
        default=False, verbose_name=_("Solicitó retiro"))
    auto_create_schema = True
    auto_drop_schema = True

    # paid and credit card data
    cc_number = CardNumberField(_('Número de tarjeta'), null=True, blank=True)
    date_expired_paid = models.DateField(_('Fecha de expiración'),
                                         null=True,
                                         blank=True)

    has_physical_delivers = models.BooleanField(
        default=True, verbose_name=_("¿Acepta envíos físicos?"))
    created_at = models.DateField(default=datetime.now, blank=True)

    def is_public(self):
        return self.schema_name == get_public_schema_name()

    def __str__(self):
        return self.name
Beispiel #20
0
class User(AbstractUser):
    credit_Card = CardNumberField('Número de tarjeta', null=True, unique=True)
    expired_Card = CardExpiryField('Fecha de vencimiento', null=True)
    secCode_Card = SecurityCodeField('Código de seguridad', null=True)
    tipo_tarjeta = models.CharField('Tipo de tarjeta',
                                    null=True,
                                    max_length=60)
    titular = models.CharField('Nombre del titular de la tarjeta',
                               null=True,
                               max_length=60)
    subscription = models.ForeignKey(Membresia,
                                     on_delete=models.CASCADE,
                                     null=True,
                                     blank=True)
    dni = models.IntegerField('DNI del titular de la tarjeta', null=True)

    def __str__(self):
        return self.username
Beispiel #21
0
class Card(models.Model):
    account = models.OneToOneField(BankAccount,
                                   on_delete=models.CASCADE,
                                   related_name='card')
    is_active = models.BooleanField(default=False)
    number = CardNumberField('card number')
    expires_date = CardExpiryField('expiration date', default='01/25')
    code = SecurityCodeField('security code')
    pin = models.PositiveIntegerField(validators=[MaxValueValidator(9999)])
    daily_online_limit = models.PositiveIntegerField(blank=True,
                                                     null=True,
                                                     default=2000)
    daily_withdrawal_limit = models.PositiveIntegerField(default=2000)
    monthly_online_limit = models.PositiveIntegerField(default=5000)
    monthly_withdrawal_limit = models.PositiveIntegerField(default=5000)

    def __str__(self):
        return 'Card account: {}'.format(self.account)
Beispiel #22
0
class CreditCards(models.Model):
    number = CardNumberField('numero')
    date_expiration = CardExpiryField('fecha de vencimiento')
    cod = SecurityCodeField('codigo de seguridad')
    card_name = models.CharField("nombre de tarjeta", max_length=50)
    bank = models.CharField(('banco'), max_length=50)
    user = models.OneToOneField(Account,
                                on_delete=models.CASCADE,
                                verbose_name="usuario")

    def publish(self):
        self.save()

    def __str__(self):
        return self.card_name

    class Meta:
        verbose_name = "Tarjeta"
        verbose_name_plural = "Tarjetas"
Beispiel #23
0
class PizzeriaRequest(Model):
    is_active = models.BooleanField(verbose_name=_("Solicitud activa"),
                                    default=True)
    representative_full_name = models.CharField(
        max_length=100,
        verbose_name=_("Nombre completo representante legal"),
        null=True)
    phone = models.CharField(max_length=10,
                             verbose_name=_("Telefono representante legal"))
    email = models.EmailField(max_length=100,
                              verbose_name=_("Email representante legal"))
    comment = models.TextField(max_length=3000, verbose_name=_("Comentario"))
    company_name = models.CharField(max_length=100,
                                    verbose_name=_("Nombre de la compañia"),
                                    null=True)
    address = models.CharField(max_length=100,
                               verbose_name=_("Dirección de la pizzeria"),
                               null=True)
    plan = models.ForeignKey(Plan, null=True, on_delete=models.CASCADE)
    cc_number = CardNumberField(_('Número de tarjeta'), null=True, blank=True)
Beispiel #24
0
class All_Bill(models.Model):
    User = models.CharField(max_length=50, null=True)  # Who is Buying the item
    Receiver = models.CharField(max_length=50,
                                null=True)  # Who will receive the Item
    City = models.CharField(max_length=50, null=True)
    Address = models.CharField(max_length=50, null=True)
    Zip = models.IntegerField(null=True)
    Name_on_Card = models.CharField(max_length=50, null=True)
    Credit_card_number = CardNumberField(null=True)
    Exp_Month = models.CharField(max_length=50, null=True)
    Exp_Year = models.IntegerField(null=True)
    CVV = models.IntegerField(
        null=True)  # CVV Stands for Cad Verification Value
    Payment = models.CharField(max_length=30,
                               null=True)  # On Delivery / Or By Card
    All_fields = models.BinaryField(
        max_length=1000,
        null=True)  # This is For Storing Items Data Prices/Pickled Object
    Amount = models.FloatField(null=True)  # Total Bill
    Date = models.DateField(null=True)
    Bill_number = models.TextField(null=True)
Beispiel #25
0
class CardNumber(models.Model):
    number = CardNumberField('card number')
Beispiel #26
0
class Visa(models.Model):

    card_owner = models.CharField(max_length=100, blank=True)
    card_number = CardNumberField(('card number') ,null=True)
    card_expiry = CardExpiryField(('expiration date'), null=True)
    cvv = SecurityCodeField(('security code'), null=True)
Beispiel #27
0
class TarjetaQueUsoPrueba(models.Model):
    numero = CardNumberField()