from django.db import models
from django.contrib.auth.models import User


class Review(models.Model):
    user = models.ForeignKey(User, default=None)
    title = models.CharField(max_length=128)
    description = models.TextField()
    date_created = models.DateTimeField(auto_now_add=True)
    last_modified = models.DateTimeField(auto_now=True)

    query = models.TextField()
    abstract_pool_size = models.IntegerField()
    document_pool_size = models.IntegerField()
    final_pool_size = models.IntegerField()


class Paper(models.Model):
    review = models.ForeignKey(Review)
    title = models.CharField(max_length=128)
    authors = models.CharField(max_length=128)
    abstract = models.TextField()
    publish_date = models.DateField()
    url = models.URLField()
    notes = models.TextField()

    ABSTRACT_POOL = 'A'
    DOCUMENT_POOL = 'D'
    FINAL_POOL = 'F'
    REJECTED = 'R'
    POOLS = ((ABSTRACT_POOL, 'Abstract pool'),
             (DOCUMENT_POOL, 'Document pool'),
             (FINAL_POOL, 'Final pool'),
             (REJECTED, 'Rejected'))

    pool = models.CharField(max_length=1, choices=POOLS, default=ABSTRACT_POOL)

from django.db import models
from django.contrib.auth.models import User


class Review(models.Model):
    user = models.ForeignKey(User, default=None)
    title = models.CharField(max_length=128)
    description = models.TextField()
    date_created = models.DateTimeField(auto_now_add=True)
    last_modified = models.DateTimeField(auto_now=True)
    completed = models.BooleanField(default=False)

    query = models.TextField()
    abstract_pool_size = models.IntegerField()
    document_pool_size = models.IntegerField()
    final_pool_size = models.IntegerField()


class Paper(models.Model):
    review = models.ForeignKey(Review)
    title = models.CharField(max_length=128)
    authors = models.CharField(max_length=128)
    abstract = models.TextField()
    publish_date = models.DateField()
    url = models.URLField()
    notes = models.TextField()

    ABSTRACT_POOL = 'A'
    DOCUMENT_POOL = 'D'
    FINAL_POOL = 'F'
    REJECTED = 'R'
    POOLS = ((ABSTRACT_POOL, 'Abstract pool'),
             (DOCUMENT_POOL, 'Document pool'),
             (FINAL_POOL, 'Final pool'),
             (REJECTED, 'Rejected'))

    pool = models.CharField(max_length=1, choices=POOLS, default=ABSTRACT_POOL)

Add completed field to review
Add completed field to review

  from django.db import models
  from django.contrib.auth.models import User
  
  
  class Review(models.Model):
      user = models.ForeignKey(User, default=None)
      title = models.CharField(max_length=128)
      description = models.TextField()
      date_created = models.DateTimeField(auto_now_add=True)
      last_modified = models.DateTimeField(auto_now=True)
+     completed = models.BooleanField(default=False)
  
      query = models.TextField()
      abstract_pool_size = models.IntegerField()
      document_pool_size = models.IntegerField()
      final_pool_size = models.IntegerField()
  
  
  class Paper(models.Model):
      review = models.ForeignKey(Review)
      title = models.CharField(max_length=128)
      authors = models.CharField(max_length=128)
      abstract = models.TextField()
      publish_date = models.DateField()
      url = models.URLField()
      notes = models.TextField()
  
      ABSTRACT_POOL = 'A'
      DOCUMENT_POOL = 'D'
      FINAL_POOL = 'F'
      REJECTED = 'R'
      POOLS = ((ABSTRACT_POOL, 'Abstract pool'),
               (DOCUMENT_POOL, 'Document pool'),
               (FINAL_POOL, 'Final pool'),
               (REJECTED, 'Rejected'))
  
      pool = models.CharField(max_length=1, choices=POOLS, default=ABSTRACT_POOL)
  
Add completed field to review
## Code Before:
from django.db import models
from django.contrib.auth.models import User


class Review(models.Model):
    user = models.ForeignKey(User, default=None)
    title = models.CharField(max_length=128)
    description = models.TextField()
    date_created = models.DateTimeField(auto_now_add=True)
    last_modified = models.DateTimeField(auto_now=True)

    query = models.TextField()
    abstract_pool_size = models.IntegerField()
    document_pool_size = models.IntegerField()
    final_pool_size = models.IntegerField()


class Paper(models.Model):
    review = models.ForeignKey(Review)
    title = models.CharField(max_length=128)
    authors = models.CharField(max_length=128)
    abstract = models.TextField()
    publish_date = models.DateField()
    url = models.URLField()
    notes = models.TextField()

    ABSTRACT_POOL = 'A'
    DOCUMENT_POOL = 'D'
    FINAL_POOL = 'F'
    REJECTED = 'R'
    POOLS = ((ABSTRACT_POOL, 'Abstract pool'),
             (DOCUMENT_POOL, 'Document pool'),
             (FINAL_POOL, 'Final pool'),
             (REJECTED, 'Rejected'))

    pool = models.CharField(max_length=1, choices=POOLS, default=ABSTRACT_POOL)

## Instruction:
Add completed field to review
## Code After:
from django.db import models
from django.contrib.auth.models import User


class Review(models.Model):
    user = models.ForeignKey(User, default=None)
    title = models.CharField(max_length=128)
    description = models.TextField()
    date_created = models.DateTimeField(auto_now_add=True)
    last_modified = models.DateTimeField(auto_now=True)
    completed = models.BooleanField(default=False)

    query = models.TextField()
    abstract_pool_size = models.IntegerField()
    document_pool_size = models.IntegerField()
    final_pool_size = models.IntegerField()


class Paper(models.Model):
    review = models.ForeignKey(Review)
    title = models.CharField(max_length=128)
    authors = models.CharField(max_length=128)
    abstract = models.TextField()
    publish_date = models.DateField()
    url = models.URLField()
    notes = models.TextField()

    ABSTRACT_POOL = 'A'
    DOCUMENT_POOL = 'D'
    FINAL_POOL = 'F'
    REJECTED = 'R'
    POOLS = ((ABSTRACT_POOL, 'Abstract pool'),
             (DOCUMENT_POOL, 'Document pool'),
             (FINAL_POOL, 'Final pool'),
             (REJECTED, 'Rejected'))

    pool = models.CharField(max_length=1, choices=POOLS, default=ABSTRACT_POOL)
