Skip to content

Commit

Permalink
dev: initiate paper models
Browse files Browse the repository at this point in the history
  • Loading branch information
pablohashescobar committed Mar 16, 2023
1 parent 0fb9a14 commit 14f0853
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions apiserver/plane/db/models/paper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Django imports
from django.db import models
from django.conf import settings

# Module imports
from . import ProjectBaseModel


class Paper(ProjectBaseModel):
name = models.CharField(max_length=255)
description = models.JSONField(default=dict, blank=True)
description_html = models.TextField(blank=True, default="<p></p>")
description_stripped = models.TextField(blank=True, null=True)
owned_by = models.ForeignKey(
settings.AUTH_USER_MODEL, on_delete=models.CASCADE, related_name="papers"
)
access = models.PositiveSmallIntegerField(
choices=((0, "Public"), (1, "Private")), default=0
)

class Meta:
verbose_name = "Paper"
verbose_name_plural = "Papers"
db_table = "papers"
ordering = ("-created_at",)


class PaperBlocks(ProjectBaseModel):
paper = models.ForeignKey(
"db.Paper", on_delete=models.CASCADE, related_name="blocks"
)
name = models.CharField(max_length=255)
description = models.JSONField(default=dict, blank=True)
description_html = models.TextField(blank=True, default="<p></p>")
description_stripped = models.TextField(blank=True, null=True)
issue = models.ForeignKey(
"db.Issue", on_delete=models.SET_NULL, related_name="blocks", null=True
)
completed = models.BooleanField(default=False)

class Meta:
verbose_name = "Paper Block"
verbose_name_plural = "Paper Blocks"
db_table = "paper_blocks"
ordering = ("-created_at",)

0 comments on commit 14f0853

Please sign in to comment.