summaryrefslogtreecommitdiff
path: root/app/income/models.py
blob: 4fb5497c02eaa5e19dccce960084a6718ca1b73e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from django.db import models
from django.utils import timezone

from resume.models import PubItem, Publisher


class Gig(models.Model):
    title = models.CharField(max_length=200)
    pitch = models.TextField(null=True, blank=True)
    created = models.DateTimeField(auto_now_add=True)
    pub_date = models.DateTimeField(default=timezone.now)
    STATUS = (
        (0, "Pitched"),
        (1, "Accepted"),
        (2, "Submitted"),
        (3, "Published"),
        (4, "Rejected"),
    )
    status = models.IntegerField(choices=STATUS, default=1)
    invoice_date = models.DateTimeField(null=True, blank=True)
    payment = models.DecimalField(max_digits=10, decimal_places=2)
    PAY_STATUS = (
        (0, "NOT SUBMITTED"),
        (1, "Invoiced"),
        (2, "Paid"),
    )
    payment_status = models.IntegerField(choices=PAY_STATUS, default=1)
    PAY_TYPE = (
        (0, "Flat Rate"),
        (1, "Per Word"),
        (2, "Hourly"),
    )
    pay_type = models.IntegerField(choices=PAY_TYPE, default=1)
    publisher = models.ForeignKey(Publisher, blank=True, null=True)
    pub_item = models.ForeignKey(PubItem, blank=True, null=True)

    def __str__(self):
        return self.title