Browse Source

Move printing_path from models to utils

printer
Maxime Bombar 7 years ago
committed by root
parent
commit
56ca2c47a4
  1. 3
      printer/models.py
  2. 10
      printer/utils.py

3
printer/models.py

@ -18,6 +18,8 @@ from re2o.mixins import RevMixin
import users.models
import unidecode
from .validators import (
FileValidator,
)
@ -33,7 +35,6 @@ from .settings import (
PERFORATION_OPTIONS,
)
from .utils import user_printing_path
import math

10
printer/utils.py

@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
import subprocess
import os
import unidecode
from django.template.loader import get_template
from django.core.mail import EmailMessage
@ -12,15 +11,6 @@ from numpy.random import randint
import datetime
def user_printing_path(instance, filename):
"""
Defines the path where will be uploaded the files
Currently MEDIA_ROOT/printings/user_<id>/<filename>
"""
# File will be uploaded to MEDIA_ROOT/printings/user_<id>/<filename>
return 'printings/user_{0}/{1}'.format(instance.user.id, unidecode.unidecode(filename))
def pdfinfo(file_path):
"""

Loading…
Cancel
Save