nuitdelinfo_2021/people/models.py

28 lines
888 B
Python
Raw Permalink Normal View History

2021-12-02 23:46:42 +01:00
from django.db.models import Model, CharField, DateField, BooleanField, ForeignKey, CASCADE
from django_quill.fields import QuillField
2021-12-02 21:57:32 +01:00
class People(Model):
2021-12-02 23:46:42 +01:00
first_name = CharField(max_length=40)
last_name = CharField(max_length=60)
2021-12-02 21:57:32 +01:00
2021-12-02 23:46:42 +01:00
title = CharField(max_length=70, null=True, blank=True)
description = QuillField()
2021-12-02 21:57:32 +01:00
2021-12-02 23:46:42 +01:00
birth = DateField()
death = DateField(null=True, blank=True)
2021-12-02 21:57:32 +01:00
2021-12-02 23:46:42 +01:00
history = QuillField(null=True, blank=True)
genealogy = QuillField(null=True, blank=True)
awards = QuillField(null=True, blank=True)
pro_life = QuillField(null=True, blank=True)
2021-12-02 21:57:32 +01:00
2021-12-02 23:46:42 +01:00
testimonials = QuillField(null=True, blank=True)
sources = QuillField()
validated = BooleanField(default=False)
pending_edit_of = ForeignKey("self", on_delete=CASCADE, null=True, blank=True)
2021-12-03 00:23:06 +01:00
def __str__(self):
return f"{self.first_name} {self.last_name}"