Browse Source

Añado usuario que creó el documento

Celestino Rey 5 tháng trước cách đây
mục cha
commit
3dbae7217b
3 tập tin đã thay đổi với 12 bổ sung2 xóa
  1. 2 1
      Dockerfile
  2. 1 1
      K8S/Makefile
  3. 9 0
      src/textdocs/models.py

+ 2 - 1
Dockerfile

@@ -1,4 +1,5 @@
-FROM python:3.14.2-alpine3.23
+#FROM python:3.14.2-alpine3.23
+FROM python:3.13.1-alpine3.21
 
 # install nginx y otras cosas
 RUN apk add nginx netcat-openbsd curl vim jq rsync pango pango-dev cairo postgresql-client bash glib fontconfig font-noto

+ 1 - 1
K8S/Makefile

@@ -1,5 +1,5 @@
 export REGISTRO=harbor.rancher.lab:30002\/siemensrad
-export IMG_VERSION = alpine-25
+export IMG_VERSION = alpine-25-15
 export NAMESPACE = trgenerator
 
 # limpia todo

+ 9 - 0
src/textdocs/models.py

@@ -1,9 +1,18 @@
 # textdocs/models.py
 from django.db import models
 from django.urls import reverse
+from django.conf import settings # Import settings
 
 class Document(models.Model):
     """Represents a single document with its fixed sections."""
+    
+    # NEW: Link to the user who created the document
+    author = models.ForeignKey(
+        settings.AUTH_USER_MODEL,
+        on_delete=models.CASCADE,
+        related_name='documents'
+    )
+
     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.")