build: merge frontend and backend into a single repo
This commit is contained in:
parent
10ce333e6f
commit
26ec1e8c15
126 changed files with 8280 additions and 1 deletions
46
apiserver/plane/db/mixins.py
Normal file
46
apiserver/plane/db/mixins.py
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
from django.db import models
|
||||
|
||||
|
||||
class TimeAuditModel(models.Model):
|
||||
|
||||
"""To path when the record was created and last modified"""
|
||||
|
||||
created_at = models.DateTimeField(
|
||||
auto_now_add=True,
|
||||
verbose_name="Created At",
|
||||
)
|
||||
updated_at = models.DateTimeField(auto_now=True, verbose_name="Last Modified At")
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
||||
|
||||
class UserAuditModel(models.Model):
|
||||
|
||||
"""To path when the record was created and last modified"""
|
||||
|
||||
created_by = models.ForeignKey(
|
||||
"db.User",
|
||||
on_delete=models.SET_NULL,
|
||||
related_name="%(class)s_created_by",
|
||||
verbose_name="Created By",
|
||||
null=True,
|
||||
)
|
||||
updated_by = models.ForeignKey(
|
||||
"db.User",
|
||||
on_delete=models.SET_NULL,
|
||||
related_name="%(class)s_updated_by",
|
||||
verbose_name="Last Modified By",
|
||||
null=True,
|
||||
)
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
||||
|
||||
class AuditModel(TimeAuditModel, UserAuditModel):
|
||||
|
||||
"""To path when the record was created and last modified"""
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
Loading…
Add table
Add a link
Reference in a new issue