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:
@@ -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):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user