SHARE
TWEET

Untitled

Alenorze Feb 18th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from django.db import models
  2. from django.conf import settings
  3.  
  4. from model_utils import Choices
  5.  
  6. from source_app.models import DomainName, Keyword
  7.  
  8. STATUS = Choices(('output', 'Output offer'), ('completed', 'Completed offer'), ('accepted', 'Accepted offer'))
  9.  
  10.  
  11.  
  12. class CwDomainRelation(models.Model):
  13.     copywriters = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete='CASCADE', related_name='copywriters', null=True, blank=True)
  14.     created_by = models.OneToOneField(settings.AUTH_USER_MODEL, on_delete='CASCADE', null=True, blank=True)
  15.     domain = models.OneToOneField(DomainName, on_delete='CASCADE', null=True, blank=True)
  16.     is_accepted = models.BooleanField(default=True)
  17.     created = models.DateTimeField(auto_now_add=True)
  18.  
  19.  
  20. class Article(models.Model):
  21.     title = models.CharField(max_length=128)
  22.     file = models.FileField()
  23.  
  24.  
  25. class Offer(models.Model):
  26.     relation = models.ForeignKey(CwDomainRelation, on_delete='CASCADE', null=True, blank=True)
  27.     keywords = models.ManyToManyField(Keyword)
  28.     is_accepted = models.BooleanField(default=False)
  29.     created = models.DateTimeField(auto_now_add=True)
  30.     status = models.CharField(choices=STATUS, default=STATUS.output, max_length=32)
  31.     article = models.OneToOneField(Article, on_delete='CASCADE', null=True, blank=True)
  32.     feedback = models.TextField(null=True, blank=True)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top