Documentation of all data models in the Articles app

Articles App Data Models Documentation

Brand values alignment: All features and data models should align with Courtex values: Community, Transparency, Accessibility, Integrity, Humility. Content should be written in Australian/UK English and follow the Courtex voice and tone guidelines. See docs/markdown/brand/voice-and-tone.md for guidance.

Overview

The Articles app manages editorial content such as news articles, blog posts, and tutorials. Content is authored in markdown and rendered to HTML on display. Note: new content management should prefer the content app over articles.

Core Models

1. Article

The Article model represents a piece of editorial content published on the Courtex platform.

Key Fields: - title: Article title (max 100 characters) - article_type: Type of article — news, blog, or tutorial - content: Markdown-formatted article body - author: Foreign key to users.User who wrote the article (PROTECT on delete) - status: Publication status — draft, published, or archived - slug: URL-safe slug (auto-generated from title if not provided; must be unique) - tags: Many-to-many tag field (via django-taggit) - published_date: Optional datetime when the article was published (auto-set on first publish)

Inherited from TimeStampedModel: - created_at, updated_at, deleted_at

Methods: - get_content_as_html(): Renders the full content field from markdown to HTML using python-markdown with the extra extension - get_preview_as_html(): Renders the first 75 characters of content from markdown to HTML (used for article previews/teasers)

Business Logic (via save()): - If slug is not set, it is auto-generated using django.utils.text.slugify(title) - If status is changed to published and published_date has not been set, published_date is automatically set to the current timestamp

Status Choices: | Value | Label | Description | |---|---|---| | draft | Draft | Not yet visible to the public | | published | Published | Visible to all users | | archived | Archived | Hidden from public; retained for historical reference |


Notes

  • Images are not currently supported in articles (placeholder field is commented out in the model)
  • The articles app is a legacy content management system; new content management should use the content app instead
  • Tags are managed via django-taggit and support filtering/searching by tag
  • Markdown rendering uses the extra extension which supports tables, fenced code blocks, and more

Related Apps

  • users: Articles have an author foreign key to users.User
  • content: The preferred newer app for content management; articles is being phased out