datatracker/ietf/status/models.py
Matthew Holloway e5e6c9bc89
feat: Site status message (#7659)
* Status WIP

* feat: Status

* fix: Status tests

* feat: status redirect

* chore: Status tests

* chore: Status tests

* feat: Status tests

* chore: Status playwright tests

* fix: PR feedback, mostly Vue and copyright dates

* fix: Status model migration tidy up

* chore: Status - one migration

* feat: status on doc/html pages

* chore: Resetting Status migration

* chore: removing unused FieldError

* fix: Update Status test to remove 'by'

* chore: fixing API test to exclude 'status'

* chore: fixing status_page test

* feat: Site Status PR feedback. URL coverage debugging

* Adding ietf.status to Tastypie omitted apps

* feat: Site Status PR feedback

* chore: correct copyright year on newly created files

* chore: repair merge damage

* chore: repair more merge damage

* fix: reconcile the api init refactor with ignoring apps

---------

Co-authored-by: Matthew Holloway <Matthew Holloway>
Co-authored-by: Robert Sparks <rjsparks@nostrum.com>
2024-08-07 13:36:21 -05:00

25 lines
1.2 KiB
Python

# Copyright The IETF Trust 2024, All Rights Reserved
# -*- coding: utf-8 -*-
from django.utils import timezone
from django.db import models
from django.db.models import ForeignKey
import debug # pyflakes:ignore
class Status(models.Model):
name = 'Status'
date = models.DateTimeField(default=timezone.now)
slug = models.SlugField(blank=False, null=False, unique=True)
title = models.CharField(max_length=255, verbose_name="Status title", help_text="Your site status notification title.")
body = models.CharField(max_length=255, verbose_name="Status body", help_text="Your site status notification body.", unique=False)
active = models.BooleanField(default=True, verbose_name="Active?", help_text="Only active messages will be shown.")
by = ForeignKey('person.Person', on_delete=models.CASCADE)
page = models.TextField(blank=True, null=True, verbose_name="More detail (markdown)", help_text="More detail shown after people click 'Read more'. If empty no 'read more' will be shown")
def __str__(self):
return "{} {} {} {}".format(self.date, self.active, self.by, self.title)
class Meta:
verbose_name_plural = "statuses"