Skip to content

Commit

Permalink
upload print files to uploads folder
Browse files Browse the repository at this point in the history
  • Loading branch information
jwoglom committed Dec 18, 2015
1 parent 6741a34 commit 30fd138
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ devconfig.json
*.sublime-project
*.sublime-workspace
intranet/apps/files/cred.py*
uploads/*
1 change: 1 addition & 0 deletions config/provision_vagrant.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ sudo -i -u vagrant bash -c "
"
source .virtualenvs/ion/bin/activate
cd intranet
mkdir -p uploads
./manage.py migrate --noinput
cd ..
chown -R vagrant: /home/vagrant
Expand Down
19 changes: 19 additions & 0 deletions intranet/apps/printing/migrations/0004_auto_20151218_1346.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
('printing', '0003_printjob_num_pages'),
]

operations = [
migrations.AlterField(
model_name='printjob',
name='file',
field=models.FileField(upload_to='uploads/'),
),
]
2 changes: 1 addition & 1 deletion intranet/apps/printing/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class PrintJob(models.Model):
user = models.ForeignKey(User, null=True, blank=True)
printer = models.CharField(max_length=100)
file = models.FileField()
file = models.FileField(upload_to="uploads/")
time = models.DateTimeField(auto_now_add=True)
printed = models.BooleanField(default=False)
num_pages = models.IntegerField(default=0)
Expand Down

0 comments on commit 30fd138

Please sign in to comment.