Modèle des fichiers joints #61

Manually merged
Darks merged 3 commits from Filoji/PCv5:dev into dev 2020-08-01 21:47:33 +02:00
1 changed files with 3 additions and 3 deletions
Showing only changes of commit 20622315bd - Show all commits

View File

@ -2,8 +2,8 @@ from app import db
from hashlib import sha256
import os
class Attachement(db.Model):
__tablename__ = 'attachement'
class Attachment(db.Model):
__tablename__ = 'attachment'
id = db.Column(db.Integer, primary_key=True)
# Original name of the file
@ -22,7 +22,7 @@ class Attachement(db.Model):
def __init__(self, file, comment):
self.name = file.filename
self.size = os.stat(file).st_size
self.hashed = hash_file(file)
self.hashed = self.hash_file(file)
self.comment = comment
def hash_file(file):