Documents removing

* adds generic modal rendering using package django-bootstrap-modal-forms
* adds document file removing from hard drive
* adds translations
This commit is contained in:
mipel
2021-07-23 18:27:53 +02:00
parent 47ec30919c
commit 8885f81770
13 changed files with 202 additions and 61 deletions
+14
View File
@@ -5,6 +5,7 @@ Contact: michel.peltriaux@sgdnord.rlp.de
Created on: 17.11.20
"""
import os
import uuid
from django.contrib.auth.models import User
@@ -65,6 +66,19 @@ class Document(BaseResource):
document = models.FileField()
comment = models.TextField()
def delete(self, using=None, keep_parents=False):
""" Custom delete function to remove the real file from the hard drive
Args:
using ():
keep_parents ():
Returns:
"""
os.remove(self.document.file.name)
super().delete(using=using, keep_parents=keep_parents)
class Geometry(BaseResource):
"""