Initial commit of new document upload workflow which allows for document promises to be returned after POST request, gh-issue #194. Add new signal when a document is uploaded and finally ready, gh-issue #193 and gh-issue #213.

This commit is contained in:
Roberto Rosario
2015-07-05 03:33:27 -04:00
parent 8f30932b6f
commit 8cc05bbefb
14 changed files with 204 additions and 110 deletions
@@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('documents', '0011_auto_20150704_0508'),
]
operations = [
migrations.AlterField(
model_name='document',
name='deleted_date_time',
field=models.DateTimeField(null=True, verbose_name='Date and time trashed', blank=True),
preserve_default=True,
),
migrations.AlterField(
model_name='documenttype',
name='delete_time_period',
field=models.PositiveIntegerField(default=30, help_text='Amount of time after which documents of this type in the trash will be deleted.', verbose_name='Delete time period'),
preserve_default=True,
),
migrations.AlterField(
model_name='documenttype',
name='delete_time_unit',
field=models.CharField(default='days', max_length=8, verbose_name='Delete time unit', choices=[('days', 'Days'), ('hours', 'Hours'), ('minutes', 'Minutes')]),
preserve_default=True,
),
migrations.AlterField(
model_name='documenttype',
name='trash_time_period',
field=models.PositiveIntegerField(help_text='Amount of time after which documents of this type will be moved to the trash.', null=True, verbose_name='Trash time period', blank=True),
preserve_default=True,
),
migrations.AlterField(
model_name='documenttype',
name='trash_time_unit',
field=models.CharField(blank=True, max_length=8, null=True, verbose_name='Trash time unit', choices=[('days', 'Days'), ('hours', 'Hours'), ('minutes', 'Minutes')]),
preserve_default=True,
),
]
@@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def make_existing_documents_not_stubs(apps, schema_editor):
Document = apps.get_model('documents', 'Document')
for document in Document.objects.all():
document.is_stub=False
document.save()
class Migration(migrations.Migration):
dependencies = [
('documents', '0012_auto_20150705_0347'),
]
operations = [
migrations.AddField(
model_name='document',
name='is_stub',
field=models.BooleanField(default=True, verbose_name='Is stub?', editable=False),
preserve_default=True,
),
migrations.RunPython(make_existing_documents_not_stubs),
]