You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
630 B

from django.db import models
from django.conf import settings
User = settings.AUTH_USER_MODEL
class InfoArticle(models.Model):
title = models.CharField(max_length=255)
content = models.TextField()
dive_base = models.ForeignKey(
'divebases.DiveBase',
on_delete=models.CASCADE,
related_name='articles'
)
created_by = models.ForeignKey(
User,
on_delete=models.PROTECT,
related_name='articles'
)
created_at = models.DateTimeField(auto_now_add=True)
is_deleted = models.BooleanField(default=False)
def __str__(self):
return self.title