| 1234567891011121314151617 |
- # textdocs/models.py
- from django.db import models
- from django.urls import reverse
- class Document(models.Model):
- """Represents a single document with its fixed sections."""
- title = models.CharField(max_length=255)
- introduction = models.TextField(help_text="The introductory section of the document.")
- main_body = models.TextField(help_text="The main content or analysis.")
- conclusion = models.TextField(help_text="The concluding remarks or summary.")
- created_at = models.DateTimeField(auto_now_add=True)
- def __str__(self):
- return self.title
- def get_absolute_url(self):
- return reverse('document_detail', kwargs={'pk': self.pk})
|