Pastebin

Paste #24997: No description

< previous paste - next paste>

Pasted by Anonymous Coward

Download View as text

from django.db import models
from django.utils import timezone
from django.conf import settings



class Customer(models.Model):
    name = models.TextField()
    email = models.EmailField(blank=True, null=True)
    phone_number = models.TextField(blank=True, null=True)
    address = models.TextField(blank=True, null=True)
    logo_path = models.TextField(blank=True, null=True)
    created_on = models.DateTimeField(default=timezone.now)

    def __str__(self):
        return self.name


class DealStage(models.Model):
    created_on = models.DateTimeField(default=timezone.now)
    name = models.TextField()
    sort_order = models.IntegerField()

    def __str__(self):
        return self.name


class Deal(models.Model):
    title = models.TextField()
    customer = models.ForeignKey(Customer, on_delete=models.SET_NULL)
    stage = models.ForeignKey(DealStage, on_delete=models.SET_NULL)
    amount = models.DecimalField(max_digits=10, decimal_places=2)
    description = models.TextField()
    created_on = models.DateTimeField(default=timezone.now)
    expected_close_date = models.DateField(blank=True, null=True)
    owner = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.SET_NULL)

    def __str__(self):
        return self.title


class Lead(models.Model):
    title = models.TextField()
    company_name = models.TextField()
    contact_name = models.TextField()
    contact_email = models.TextField(blank=True, null=True)
    contact_phone = models.TextField(blank=True, null=True)
    contact_title = models.TextField(blank=True, null=True)
    contact_other = models.TextField(blank=True, null=True)
    company_address = models.TextField(blank=True, null=True)
    company_country = models.TextField(blank=True, null=True)
    message = models.TextField(blank=True, null=True)
    notes = models.TextField(blank=True, null=True)
    status = models.TextField(blank=True, null=True)
    source = models.TextField(blank=True, null=True)
    created_on = models.DateTimeField(default=timezone.now)


    def __str__(self):
        return self.title


class LeadStage(models.Model):
    pass

New Paste


Do not write anything in this field if you're a human.

Go to most recent paste.