Code cleanups
PEP8 cleanups. Add keyword arguments. Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.10.5 on 2017-01-24 07:37
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
def move_from_content_type_user_to_foreign_key_field_user(apps, schema_editor):
|
def operation_move_from_content_type_user_to_foreign_key_field_user(apps, schema_editor):
|
||||||
# The model references the use who checked out the document using a
|
# The model references the use who checked out the document using a
|
||||||
# generic.GenericForeignKey. This migrations changes that to a simpler
|
# generic.GenericForeignKey. This migrations changes that to a simpler
|
||||||
# ForeignKey to the User model
|
# ForeignKey to the User model
|
||||||
|
|
||||||
DocumentCheckout = apps.get_model('checkouts', 'DocumentCheckout')
|
DocumentCheckout = apps.get_model(
|
||||||
|
app_label='checkouts', model_name='DocumentCheckout'
|
||||||
|
)
|
||||||
|
|
||||||
for document_checkout in DocumentCheckout.objects.using(schema_editor.connection.alias).all():
|
for document_checkout in DocumentCheckout.objects.using(schema_editor.connection.alias).all():
|
||||||
document_checkout.user = document_checkout.user_object
|
document_checkout.user = document_checkout.user_object
|
||||||
@@ -24,6 +25,6 @@ class Migration(migrations.Migration):
|
|||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
migrations.RunPython(
|
migrations.RunPython(
|
||||||
move_from_content_type_user_to_foreign_key_field_user
|
code=operation_move_from_content_type_user_to_foreign_key_field_user
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
@@ -14,6 +13,8 @@ class Migration(migrations.Migration):
|
|||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='documentcheckout',
|
model_name='documentcheckout',
|
||||||
name='document',
|
name='document',
|
||||||
field=models.OneToOneField(verbose_name='Document', to='documents.Document'),
|
field=models.OneToOneField(
|
||||||
|
verbose_name='Document', to='documents.Document'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.9.11 on 2016-12-22 05:34
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
@@ -17,8 +15,18 @@ class Migration(migrations.Migration):
|
|||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='NewVersionBlock',
|
name='NewVersionBlock',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
(
|
||||||
('document', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='documents.Document', verbose_name='Document')),
|
'id', models.AutoField(
|
||||||
|
auto_created=True, primary_key=True, serialize=False,
|
||||||
|
verbose_name='ID'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'document', models.ForeignKey(
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
to='documents.Document', verbose_name='Document'
|
||||||
|
)
|
||||||
|
),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'verbose_name': 'New version block',
|
'verbose_name': 'New version block',
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.11.10 on 2018-03-10 17:15
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
@@ -14,6 +12,9 @@ class Migration(migrations.Migration):
|
|||||||
operations = [
|
operations = [
|
||||||
migrations.AlterModelOptions(
|
migrations.AlterModelOptions(
|
||||||
name='documentcheckout',
|
name='documentcheckout',
|
||||||
options={'ordering': ('pk',), 'verbose_name': 'Document checkout', 'verbose_name_plural': 'Document checkouts'},
|
options={
|
||||||
|
'ordering': ('pk',), 'verbose_name': 'Document checkout',
|
||||||
|
'verbose_name_plural': 'Document checkouts'
|
||||||
|
},
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.10.7 on 2017-08-25 06:52
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
@@ -17,12 +15,41 @@ class Migration(migrations.Migration):
|
|||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='ErrorLogEntry',
|
name='ErrorLogEntry',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
(
|
||||||
('namespace', models.CharField(max_length=128, verbose_name='Namespace')),
|
'id', models.AutoField(
|
||||||
('object_id', models.PositiveIntegerField(blank=True, null=True)),
|
auto_created=True, primary_key=True, serialize=False,
|
||||||
('datetime', models.DateTimeField(auto_now_add=True, db_index=True, verbose_name='Date time')),
|
verbose_name='ID'
|
||||||
('result', models.TextField(blank=True, null=True, verbose_name='Result')),
|
)
|
||||||
('content_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='error_log_content_type', to='contenttypes.ContentType')),
|
),
|
||||||
|
(
|
||||||
|
'namespace', models.CharField(
|
||||||
|
max_length=128, verbose_name='Namespace'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'object_id', models.PositiveIntegerField(
|
||||||
|
blank=True, null=True
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'datetime', models.DateTimeField(
|
||||||
|
auto_now_add=True, db_index=True,
|
||||||
|
verbose_name='Date time'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'result', models.TextField(
|
||||||
|
blank=True, null=True, verbose_name='Result'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'content_type', models.ForeignKey(
|
||||||
|
blank=True, null=True,
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
related_name='error_log_content_type',
|
||||||
|
to='contenttypes.ContentType'
|
||||||
|
)
|
||||||
|
),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'ordering': ('datetime',),
|
'ordering': ('datetime',),
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.11.11 on 2018-04-03 07:02
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import mayan.apps.common.models
|
import mayan.apps.common.models
|
||||||
@@ -17,6 +15,11 @@ class Migration(migrations.Migration):
|
|||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='shareduploadedfile',
|
model_name='shareduploadedfile',
|
||||||
name='file',
|
name='file',
|
||||||
field=models.FileField(storage=django.core.files.storage.FileSystemStorage(location=b'mayan/media/shared_files'), upload_to=mayan.apps.common.models.upload_to, verbose_name='File'),
|
field=models.FileField(
|
||||||
|
storage=django.core.files.storage.FileSystemStorage(
|
||||||
|
location=b'mayan/media/shared_files'
|
||||||
|
), upload_to=mayan.apps.common.models.upload_to,
|
||||||
|
verbose_name='File'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.11.11 on 2018-04-29 07:58
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import mayan.apps.common.models
|
import mayan.apps.common.models
|
||||||
@@ -17,6 +15,11 @@ class Migration(migrations.Migration):
|
|||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='shareduploadedfile',
|
model_name='shareduploadedfile',
|
||||||
name='file',
|
name='file',
|
||||||
field=models.FileField(storage=django.core.files.storage.FileSystemStorage(location=b'/home/rosarior/development/mayan-edms/mayan/media/shared_files'), upload_to=mayan.apps.common.models.upload_to, verbose_name='File'),
|
field=models.FileField(
|
||||||
|
storage=django.core.files.storage.FileSystemStorage(
|
||||||
|
location=b'/home/rosarior/development/mayan-edms/mayan/media/shared_files'
|
||||||
|
), upload_to=mayan.apps.common.models.upload_to,
|
||||||
|
verbose_name='File'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
@@ -41,7 +40,9 @@ class Migration(migrations.Migration):
|
|||||||
(
|
(
|
||||||
'arguments', models.TextField(
|
'arguments', models.TextField(
|
||||||
blank=True, null=True, verbose_name='Arguments',
|
blank=True, null=True, verbose_name='Arguments',
|
||||||
validators=[mayan.apps.converter.validators.YAMLValidator]
|
validators=[
|
||||||
|
mayan.apps.converter.validators.YAMLValidator
|
||||||
|
]
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.10.5 on 2017-01-18 17:58
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
@@ -15,6 +13,21 @@ class Migration(migrations.Migration):
|
|||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='transformation',
|
model_name='transformation',
|
||||||
name='name',
|
name='name',
|
||||||
field=models.CharField(choices=[('crop', 'Crop: left, top, right, bottom'), ('flip', 'Flip'), ('gaussianblur', 'Gaussian blur: radius'), ('mirror', 'Mirror'), ('resize', 'Resize: width, height'), ('rotate', 'Rotate: degrees'), ('rotate180', 'Rotate 180 degrees'), ('rotate270', 'Rotate 270 degrees'), ('rotate90', 'Rotate 90 degrees'), ('unsharpmask', 'Unsharp masking: radius, percent, threshold'), ('zoom', 'Zoom: percent')], max_length=128, verbose_name='Name'),
|
field=models.CharField(
|
||||||
|
choices=[
|
||||||
|
('crop', 'Crop: left, top, right, bottom'),
|
||||||
|
('flip', 'Flip'),
|
||||||
|
('gaussianblur', 'Gaussian blur: radius'),
|
||||||
|
('mirror', 'Mirror'), ('resize', 'Resize: width, height'),
|
||||||
|
('rotate', 'Rotate: degrees'),
|
||||||
|
('rotate180', 'Rotate 180 degrees'),
|
||||||
|
('rotate270', 'Rotate 270 degrees'),
|
||||||
|
('rotate90', 'Rotate 90 degrees'),
|
||||||
|
(
|
||||||
|
'unsharpmask',
|
||||||
|
'Unsharp masking: radius, percent, threshold'
|
||||||
|
), ('zoom', 'Zoom: percent')
|
||||||
|
], max_length=128, verbose_name='Name'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.10.7 on 2017-07-14 21:33
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
@@ -15,6 +13,22 @@ class Migration(migrations.Migration):
|
|||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='transformation',
|
model_name='transformation',
|
||||||
name='name',
|
name='name',
|
||||||
field=models.CharField(choices=[('crop', 'Crop: left, top, right, bottom'), ('flip', 'Flip'), ('gaussianblur', 'Gaussian blur: radius'), ('lineart', 'Line art'), ('mirror', 'Mirror'), ('resize', 'Resize: width, height'), ('rotate', 'Rotate: degrees'), ('rotate180', 'Rotate 180 degrees'), ('rotate270', 'Rotate 270 degrees'), ('rotate90', 'Rotate 90 degrees'), ('unsharpmask', 'Unsharp masking: radius, percent, threshold'), ('zoom', 'Zoom: percent')], max_length=128, verbose_name='Name'),
|
field=models.CharField(
|
||||||
|
choices=[
|
||||||
|
('crop', 'Crop: left, top, right, bottom'),
|
||||||
|
('flip', 'Flip'),
|
||||||
|
('gaussianblur', 'Gaussian blur: radius'),
|
||||||
|
('lineart', 'Line art'), ('mirror', 'Mirror'),
|
||||||
|
('resize', 'Resize: width, height'),
|
||||||
|
('rotate', 'Rotate: degrees'),
|
||||||
|
('rotate180', 'Rotate 180 degrees'),
|
||||||
|
('rotate270', 'Rotate 270 degrees'),
|
||||||
|
('rotate90', 'Rotate 90 degrees'),
|
||||||
|
(
|
||||||
|
'unsharpmask',
|
||||||
|
'Unsharp masking: radius, percent, threshold'
|
||||||
|
), ('zoom', 'Zoom: percent')
|
||||||
|
], max_length=128, verbose_name='Name'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.11.11 on 2018-08-23 23:53
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
@@ -15,6 +13,22 @@ class Migration(migrations.Migration):
|
|||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='transformation',
|
model_name='transformation',
|
||||||
name='name',
|
name='name',
|
||||||
field=models.CharField(choices=[('crop', 'Crop: left, top, right, bottom'), ('flip', 'Flip'), ('gaussianblur', 'Gaussian blur: radius'), ('lineart', 'Line art'), ('mirror', 'Mirror'), ('resize', 'Resize: width, height'), ('rotate', 'Rotate: degrees, fillcolor'), ('rotate180', 'Rotate 180 degrees'), ('rotate270', 'Rotate 270 degrees'), ('rotate90', 'Rotate 90 degrees'), ('unsharpmask', 'Unsharp masking: radius, percent, threshold'), ('zoom', 'Zoom: percent')], max_length=128, verbose_name='Name'),
|
field=models.CharField(
|
||||||
|
choices=[
|
||||||
|
('crop', 'Crop: left, top, right, bottom'),
|
||||||
|
('flip', 'Flip'),
|
||||||
|
('gaussianblur', 'Gaussian blur: radius'),
|
||||||
|
('lineart', 'Line art'), ('mirror', 'Mirror'),
|
||||||
|
('resize', 'Resize: width, height'),
|
||||||
|
('rotate', 'Rotate: degrees, fillcolor'),
|
||||||
|
('rotate180', 'Rotate 180 degrees'),
|
||||||
|
('rotate270', 'Rotate 270 degrees'),
|
||||||
|
('rotate90', 'Rotate 90 degrees'),
|
||||||
|
(
|
||||||
|
'unsharpmask',
|
||||||
|
'Unsharp masking: radius, percent, threshold'
|
||||||
|
), ('zoom', 'Zoom: percent')
|
||||||
|
], max_length=128, verbose_name='Name'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -173,7 +173,8 @@ class Dependency(object):
|
|||||||
|
|
||||||
for dependency in cls.get_all():
|
for dependency in cls.get_all():
|
||||||
print('* ', end='')
|
print('* ', end='')
|
||||||
print(template.format(
|
print(
|
||||||
|
template.format(
|
||||||
dependency.name,
|
dependency.name,
|
||||||
force_text(dependency.class_name_verbose_name),
|
force_text(dependency.class_name_verbose_name),
|
||||||
force_text(dependency.get_version_string()),
|
force_text(dependency.get_version_string()),
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ from __future__ import unicode_literals
|
|||||||
from django.core import management
|
from django.core import management
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
from ...classes import PythonDependency, DependencyGroup
|
from ...classes import PythonDependency
|
||||||
|
|
||||||
|
|
||||||
class Command(management.BaseCommand):
|
class Command(management.BaseCommand):
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
||||||
|
|
||||||
def migrate_old_comments(apps, schema_editor):
|
def operation_migrate_old_comments(apps, schema_editor):
|
||||||
# https://code.djangoproject.com/ticket/24282
|
# https://code.djangoproject.com/ticket/24282
|
||||||
# If someone has a better solution until Django 1.8, would appreciate
|
# If someone has a better solution until Django 1.8, would appreciate
|
||||||
# a pull-request :)
|
# a pull-request :)
|
||||||
@@ -17,13 +16,19 @@ def migrate_old_comments(apps, schema_editor):
|
|||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
|
||||||
Comment = apps.get_model('document_comments', 'Comment')
|
Comment = apps.get_model(
|
||||||
Document = apps.get_model('documents', 'Document')
|
app_label='document_comments', model_name='Comment'
|
||||||
|
)
|
||||||
|
Document = apps.get_model(
|
||||||
|
app_label='documents', model_name='Document'
|
||||||
|
)
|
||||||
User = apps.get_model(*settings.AUTH_USER_MODEL.split('.'))
|
User = apps.get_model(*settings.AUTH_USER_MODEL.split('.'))
|
||||||
|
|
||||||
for old_comment in OldComment.objects.using(schema_editor.connection.alias).all():
|
for old_comment in OldComment.objects.using(schema_editor.connection.alias).all():
|
||||||
comment = Comment(
|
comment = Comment(
|
||||||
document=Document.objects.using(schema_editor.connection.alias).get(pk=old_comment.object_pk),
|
document=Document.objects.using(
|
||||||
|
schema_editor.connection.alias
|
||||||
|
).get(pk=old_comment.object_pk),
|
||||||
user=User(old_comment.user.pk),
|
user=User(old_comment.user.pk),
|
||||||
comment=old_comment.comment,
|
comment=old_comment.comment,
|
||||||
submit_date=old_comment.submit_date,
|
submit_date=old_comment.submit_date,
|
||||||
@@ -42,5 +47,5 @@ class Migration(migrations.Migration):
|
|||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
migrations.RunPython(migrate_old_comments),
|
migrations.RunPython(code=operation_migrate_old_comments),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
from django.template.defaultfilters import slugify
|
from django.template.defaultfilters import slugify
|
||||||
|
|
||||||
|
|
||||||
def assign_slugs(apps, schema_editor):
|
def operation_assign_slugs(apps, schema_editor):
|
||||||
Index = apps.get_model('document_indexing', 'Index')
|
Index = apps.get_model(app_label='document_indexing', model_name='Index')
|
||||||
|
|
||||||
for index in Index.objects.using(schema_editor.connection.alias).all():
|
for index in Index.objects.using(schema_editor.connection.alias).all():
|
||||||
index.slug = slugify(index.label)
|
index.slug = slugify(index.label)
|
||||||
@@ -20,5 +19,5 @@ class Migration(migrations.Migration):
|
|||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
migrations.RunPython(assign_slugs),
|
migrations.RunPython(code=operation_assign_slugs),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.10.6 on 2017-05-24 04:56
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.10.7 on 2017-05-30 07:28
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
@@ -16,16 +14,27 @@ class Migration(migrations.Migration):
|
|||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='index',
|
model_name='index',
|
||||||
name='slug',
|
name='slug',
|
||||||
field=models.SlugField(help_text='This value will be used by other apps to reference this index.', max_length=128, unique=True, verbose_name='Slug'),
|
field=models.SlugField(
|
||||||
|
help_text='This value will be used by other apps to reference '
|
||||||
|
'this index.', max_length=128, unique=True, verbose_name='Slug'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='indexinstancenode',
|
model_name='indexinstancenode',
|
||||||
name='documents',
|
name='documents',
|
||||||
field=models.ManyToManyField(related_name='index_instance_nodes', to='documents.Document', verbose_name='Documents'),
|
field=models.ManyToManyField(
|
||||||
|
related_name='index_instance_nodes', to='documents.Document',
|
||||||
|
verbose_name='Documents'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='indexinstancenode',
|
model_name='indexinstancenode',
|
||||||
name='index_template_node',
|
name='index_template_node',
|
||||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='index_instance_nodes', to='document_indexing.IndexTemplateNode', verbose_name='Index template node'),
|
field=models.ForeignKey(
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
related_name='index_instance_nodes',
|
||||||
|
to='document_indexing.IndexTemplateNode',
|
||||||
|
verbose_name='Index template node'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.10.7 on 2017-07-14 21:33
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
@@ -14,6 +12,9 @@ class Migration(migrations.Migration):
|
|||||||
operations = [
|
operations = [
|
||||||
migrations.AlterModelOptions(
|
migrations.AlterModelOptions(
|
||||||
name='index',
|
name='index',
|
||||||
options={'ordering': ('label',), 'verbose_name': 'Index', 'verbose_name_plural': 'Indexes'},
|
options={
|
||||||
|
'ordering': ('label',), 'verbose_name': 'Index',
|
||||||
|
'verbose_name_plural': 'Indexes'
|
||||||
|
},
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.11.11 on 2018-08-23 23:53
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
@@ -15,6 +13,11 @@ class Migration(migrations.Migration):
|
|||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='indextemplatenode',
|
model_name='indextemplatenode',
|
||||||
name='expression',
|
name='expression',
|
||||||
field=models.TextField(help_text="Enter a template to render. Use Django's default templating language (https://docs.djangoproject.com/en/1.11/ref/templates/builtins/)", verbose_name='Indexing expression'),
|
field=models.TextField(
|
||||||
|
help_text="Enter a template to render. Use Django's default "
|
||||||
|
"templating language "
|
||||||
|
"(https://docs.djangoproject.com/en/1.11/ref/templates/builtins/)",
|
||||||
|
verbose_name='Indexing expression'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.11.20 on 2019-04-29 19:22
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
@@ -15,6 +13,9 @@ class Migration(migrations.Migration):
|
|||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='index',
|
model_name='index',
|
||||||
name='document_types',
|
name='document_types',
|
||||||
field=models.ManyToManyField(related_name='indexes', to='documents.DocumentType', verbose_name='Document types'),
|
field=models.ManyToManyField(
|
||||||
|
related_name='indexes', to='documents.DocumentType',
|
||||||
|
verbose_name='Document types'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.10.7 on 2017-08-23 18:55
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.10.7 on 2017-08-27 16:17
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|||||||
@@ -1,29 +1,39 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.11.11 on 2018-04-10 06:39
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
def create_parsing_setting_for_existing_document_types(apps, schema_editor):
|
def operation_create_parsing_setting_for_existing_document_types(apps, schema_editor):
|
||||||
DocumentType = apps.get_model('documents', 'DocumentType')
|
DocumentType = apps.get_model(
|
||||||
DocumentTypeSettings = apps.get_model('document_parsing', 'DocumentTypeSettings')
|
app_label='documents', model_name='DocumentType'
|
||||||
|
)
|
||||||
|
DocumentTypeSettings = apps.get_model(
|
||||||
|
app_label='document_parsing', model_name='DocumentTypeSettings'
|
||||||
|
)
|
||||||
|
|
||||||
for document_type in DocumentType.objects.using(schema_editor.connection.alias).all():
|
for document_type in DocumentType.objects.using(schema_editor.connection.alias).all():
|
||||||
try:
|
try:
|
||||||
DocumentTypeSettings.objects.using(schema_editor.connection.alias).create(document_type=document_type)
|
DocumentTypeSettings.objects.using(
|
||||||
|
schema_editor.connection.alias
|
||||||
|
).create(document_type=document_type)
|
||||||
except DocumentTypeSettings.DoesNotExist:
|
except DocumentTypeSettings.DoesNotExist:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def delete_parsing_setting_for_existing_document_types(apps, schema_editor):
|
def operation_delete_parsing_setting_for_existing_document_types(apps, schema_editor):
|
||||||
DocumentType = apps.get_model('documents', 'DocumentType')
|
DocumentType = apps.get_model(
|
||||||
DocumentTypeSettings = apps.get_model('document_parsing', 'DocumentTypeSettings')
|
app_label='documents', model_name='DocumentType'
|
||||||
|
)
|
||||||
|
DocumentTypeSettings = apps.get_model(
|
||||||
|
app_label='document_parsing', model_name='DocumentTypeSettings'
|
||||||
|
)
|
||||||
|
|
||||||
for document_type in DocumentType.objects.using(schema_editor.connection.alias).all():
|
for document_type in DocumentType.objects.using(schema_editor.connection.alias).all():
|
||||||
try:
|
try:
|
||||||
DocumentTypeSettings.objects.using(schema_editor.connection.alias).get(document_type=document_type).delete()
|
DocumentTypeSettings.objects.using(
|
||||||
|
schema_editor.connection.alias
|
||||||
|
).get(document_type=document_type).delete()
|
||||||
except DocumentTypeSettings.DoesNotExist:
|
except DocumentTypeSettings.DoesNotExist:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@@ -39,9 +49,26 @@ class Migration(migrations.Migration):
|
|||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='DocumentTypeSettings',
|
name='DocumentTypeSettings',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
(
|
||||||
('auto_parsing', models.BooleanField(default=True, verbose_name='Automatically queue newly created documents for parsing.')),
|
'id', models.AutoField(
|
||||||
('document_type', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='parsing_settings', to='documents.DocumentType', verbose_name='Document type')),
|
auto_created=True, primary_key=True, serialize=False,
|
||||||
|
verbose_name='ID'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'auto_parsing', models.BooleanField(
|
||||||
|
default=True, verbose_name='Automatically queue '
|
||||||
|
'newly created documents for parsing.'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'document_type', models.OneToOneField(
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
related_name='parsing_settings',
|
||||||
|
to='documents.DocumentType',
|
||||||
|
verbose_name='Document type'
|
||||||
|
)
|
||||||
|
),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'verbose_name': 'Document type settings',
|
'verbose_name': 'Document type settings',
|
||||||
@@ -49,7 +76,7 @@ class Migration(migrations.Migration):
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
migrations.RunPython(
|
migrations.RunPython(
|
||||||
code=create_parsing_setting_for_existing_document_types,
|
code=operation_create_parsing_setting_for_existing_document_types,
|
||||||
reverse_code=delete_parsing_setting_for_existing_document_types,
|
reverse_code=operation_delete_parsing_setting_for_existing_document_types,
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.11.11 on 2018-09-17 06:45
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
@@ -15,6 +13,9 @@ class Migration(migrations.Migration):
|
|||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='documentpagecontent',
|
model_name='documentpagecontent',
|
||||||
name='content',
|
name='content',
|
||||||
field=models.TextField(blank=True, help_text='The actual text content as extracted by the document parsing backend.', verbose_name='Content'),
|
field=models.TextField(
|
||||||
|
blank=True, help_text='The actual text content as extracted '
|
||||||
|
'by the document parsing backend.', verbose_name='Content'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
@@ -27,7 +26,8 @@ class Migration(migrations.Migration):
|
|||||||
name='signature_file',
|
name='signature_file',
|
||||||
field=models.FileField(
|
field=models.FileField(
|
||||||
storage=FileSystemStorage(),
|
storage=FileSystemStorage(),
|
||||||
upload_to=mayan.apps.document_signatures.models.upload_to, null=True,
|
upload_to=mayan.apps.document_signatures.models.upload_to,
|
||||||
|
null=True,
|
||||||
verbose_name='Signature file', blank=True
|
verbose_name='Signature file', blank=True
|
||||||
),
|
),
|
||||||
preserve_default=True,
|
preserve_default=True,
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.11.11 on 2018-04-03 07:02
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import django.core.files.storage
|
import django.core.files.storage
|
||||||
@@ -18,6 +16,12 @@ class Migration(migrations.Migration):
|
|||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='detachedsignature',
|
model_name='detachedsignature',
|
||||||
name='signature_file',
|
name='signature_file',
|
||||||
field=models.FileField(blank=True, null=True, storage=django.core.files.storage.FileSystemStorage(location=b'mayan/media/document_storage'), upload_to=mayan.apps.document_signatures.models.upload_to, verbose_name='Signature file'),
|
field=models.FileField(
|
||||||
|
blank=True, null=True,
|
||||||
|
storage=django.core.files.storage.FileSystemStorage(
|
||||||
|
location=b'mayan/media/document_storage'
|
||||||
|
), upload_to=mayan.apps.document_signatures.models.upload_to,
|
||||||
|
verbose_name='Signature file'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.11.11 on 2018-04-29 07:59
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import django.core.files.storage
|
import django.core.files.storage
|
||||||
@@ -19,10 +17,12 @@ class Migration(migrations.Migration):
|
|||||||
model_name='detachedsignature',
|
model_name='detachedsignature',
|
||||||
name='signature_file',
|
name='signature_file',
|
||||||
field=models.FileField(
|
field=models.FileField(
|
||||||
blank=True, null=True, storage=django.core.files.storage.FileSystemStorage(
|
blank=True, null=True,
|
||||||
|
storage=django.core.files.storage.FileSystemStorage(
|
||||||
location=b'/home/rosarior/development/mayan-edms/mayan/media/document_signatures'
|
location=b'/home/rosarior/development/mayan-edms/mayan/media/document_signatures'
|
||||||
),
|
),
|
||||||
upload_to=mayan.apps.document_signatures.models.upload_to, verbose_name='Signature file'
|
upload_to=mayan.apps.document_signatures.models.upload_to,
|
||||||
|
verbose_name='Signature file'
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.10.5 on 2017-03-25 04:47
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.10.7 on 2017-06-03 18:26
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
@@ -8,8 +6,10 @@ from django.utils.text import slugify
|
|||||||
from mayan.apps.common.validators import validate_internal_name
|
from mayan.apps.common.validators import validate_internal_name
|
||||||
|
|
||||||
|
|
||||||
def generate_internal_name(apps, schema_editor):
|
def operation_generate_internal_name(apps, schema_editor):
|
||||||
Workflow = apps.get_model('document_states', 'Workflow')
|
Workflow = apps.get_model(
|
||||||
|
app_label='document_states', model_name='Workflow'
|
||||||
|
)
|
||||||
internal_names = []
|
internal_names = []
|
||||||
|
|
||||||
for workflow in Workflow.objects.using(schema_editor.connection.alias).all():
|
for workflow in Workflow.objects.using(schema_editor.connection.alias).all():
|
||||||
@@ -50,7 +50,8 @@ class Migration(migrations.Migration):
|
|||||||
|
|
||||||
# Generate the slugs based on the labels
|
# Generate the slugs based on the labels
|
||||||
migrations.RunPython(
|
migrations.RunPython(
|
||||||
generate_internal_name, reverse_code=migrations.RunPython.noop
|
code=operation_generate_internal_name,
|
||||||
|
reverse_code=migrations.RunPython.noop
|
||||||
),
|
),
|
||||||
|
|
||||||
# Make the internal name field unique
|
# Make the internal name field unique
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.10.7 on 2017-08-03 06:38
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
@@ -17,8 +15,19 @@ class Migration(migrations.Migration):
|
|||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='WorkflowTransitionTriggerEvent',
|
name='WorkflowTransitionTriggerEvent',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
(
|
||||||
('stored_event_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='trigger_events', to='events.EventType', verbose_name='Event type')),
|
'id', models.AutoField(
|
||||||
|
auto_created=True, primary_key=True, serialize=False,
|
||||||
|
verbose_name='ID'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'stored_event_type', models.ForeignKey(
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
related_name='trigger_events', to='events.EventType',
|
||||||
|
verbose_name='Event type'
|
||||||
|
)
|
||||||
|
),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'verbose_name': 'Workflow transition trigger event',
|
'verbose_name': 'Workflow transition trigger event',
|
||||||
@@ -28,16 +37,29 @@ class Migration(migrations.Migration):
|
|||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='workflowtransition',
|
model_name='workflowtransition',
|
||||||
name='trigger_time_period',
|
name='trigger_time_period',
|
||||||
field=models.PositiveIntegerField(blank=True, help_text='Amount of time after which this transition will trigger on its own.', null=True, verbose_name='Trigger time period'),
|
field=models.PositiveIntegerField(
|
||||||
|
blank=True, help_text='Amount of time after which this '
|
||||||
|
'transition will trigger on its own.', null=True,
|
||||||
|
verbose_name='Trigger time period'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='workflowtransition',
|
model_name='workflowtransition',
|
||||||
name='trigger_time_unit',
|
name='trigger_time_unit',
|
||||||
field=models.CharField(blank=True, choices=[('days', 'Days'), ('hours', 'Hours'), ('minutes', 'Minutes')], max_length=8, null=True, verbose_name='Trigger time unit'),
|
field=models.CharField(
|
||||||
|
blank=True, choices=[
|
||||||
|
('days', 'Days'), ('hours', 'Hours'),
|
||||||
|
('minutes', 'Minutes')
|
||||||
|
], max_length=8, null=True, verbose_name='Trigger time unit'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='workflowtransitiontriggerevent',
|
model_name='workflowtransitiontriggerevent',
|
||||||
name='transition',
|
name='transition',
|
||||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='document_states.WorkflowTransition', verbose_name='Transition'),
|
field=models.ForeignKey(
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
to='document_states.WorkflowTransition',
|
||||||
|
verbose_name='Transition'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.10.7 on 2017-08-03 06:51
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.10.7 on 2017-08-03 07:28
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
@@ -17,16 +15,28 @@ class Migration(migrations.Migration):
|
|||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='workflowinstancelogentry',
|
model_name='workflowinstancelogentry',
|
||||||
name='user',
|
name='user',
|
||||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='User'),
|
field=models.ForeignKey(
|
||||||
|
blank=True, null=True,
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
to=settings.AUTH_USER_MODEL, verbose_name='User'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='workflowtransitiontriggerevent',
|
model_name='workflowtransitiontriggerevent',
|
||||||
name='event_type',
|
name='event_type',
|
||||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='events.EventType', verbose_name='Event type'),
|
field=models.ForeignKey(
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
to='events.EventType', verbose_name='Event type'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='workflowtransitiontriggerevent',
|
model_name='workflowtransitiontriggerevent',
|
||||||
name='transition',
|
name='transition',
|
||||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='trigger_events', to='document_states.WorkflowTransition', verbose_name='Transition'),
|
field=models.ForeignKey(
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
related_name='trigger_events',
|
||||||
|
to='document_states.WorkflowTransition',
|
||||||
|
verbose_name='Transition'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.10.7 on 2017-08-03 07:52
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.10.7 on 2017-08-07 06:12
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
@@ -16,13 +14,49 @@ class Migration(migrations.Migration):
|
|||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='WorkflowStateAction',
|
name='WorkflowStateAction',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
(
|
||||||
('label', models.CharField(max_length=255, verbose_name='Label')),
|
'id', models.AutoField(
|
||||||
('enabled', models.BooleanField(default=True, verbose_name='Enabled')),
|
auto_created=True, primary_key=True, serialize=False,
|
||||||
('when', models.PositiveIntegerField(choices=[(1, 'On entry'), (2, 'On exit')], default=1, help_text='At which moment of the state this action will execute', verbose_name='When')),
|
verbose_name='ID'
|
||||||
('action_path', models.CharField(help_text='The dotted Python path to the workflow action class to execute.', max_length=128, verbose_name='Entry action path')),
|
)
|
||||||
('action_data', models.TextField(blank=True, verbose_name='Entry action data')),
|
),
|
||||||
('state', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='actions', to='document_states.WorkflowState', verbose_name='Workflow state')),
|
(
|
||||||
|
'label', models.CharField(
|
||||||
|
max_length=255, verbose_name='Label'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'enabled', models.BooleanField(
|
||||||
|
default=True, verbose_name='Enabled'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'when', models.PositiveIntegerField(
|
||||||
|
choices=[(1, 'On entry'), (2, 'On exit')], default=1,
|
||||||
|
help_text='At which moment of the state this action '
|
||||||
|
'will execute', verbose_name='When'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'action_path', models.CharField(
|
||||||
|
help_text='The dotted Python path to the workflow '
|
||||||
|
'action class to execute.', max_length=128,
|
||||||
|
verbose_name='Entry action path'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'action_data', models.TextField(
|
||||||
|
blank=True, verbose_name='Entry action data'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'state', models.ForeignKey(
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
related_name='actions',
|
||||||
|
to='document_states.WorkflowState',
|
||||||
|
verbose_name='Workflow state'
|
||||||
|
)
|
||||||
|
),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'ordering': ('label',),
|
'ordering': ('label',),
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.11.10 on 2018-03-10 17:17
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
@@ -14,6 +12,10 @@ class Migration(migrations.Migration):
|
|||||||
operations = [
|
operations = [
|
||||||
migrations.AlterModelOptions(
|
migrations.AlterModelOptions(
|
||||||
name='workflowinstancelogentry',
|
name='workflowinstancelogentry',
|
||||||
options={'ordering': ('datetime',), 'verbose_name': 'Workflow instance log entry', 'verbose_name_plural': 'Workflow instance log entries'},
|
options={
|
||||||
|
'ordering': ('datetime',),
|
||||||
|
'verbose_name': 'Workflow instance log entry',
|
||||||
|
'verbose_name_plural': 'Workflow instance log entries'
|
||||||
|
},
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.11.10 on 2018-03-15 00:29
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
@@ -14,6 +12,9 @@ class Migration(migrations.Migration):
|
|||||||
operations = [
|
operations = [
|
||||||
migrations.AlterModelOptions(
|
migrations.AlterModelOptions(
|
||||||
name='workflowinstance',
|
name='workflowinstance',
|
||||||
options={'ordering': ('workflow',), 'verbose_name': 'Workflow instance', 'verbose_name_plural': 'Workflow instances'},
|
options={
|
||||||
|
'ordering': ('workflow',), 'verbose_name': 'Workflow instance',
|
||||||
|
'verbose_name_plural': 'Workflow instances'
|
||||||
|
},
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.11.11 on 2018-08-23 23:53
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
@@ -15,6 +13,9 @@ class Migration(migrations.Migration):
|
|||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='workflowstateaction',
|
model_name='workflowstateaction',
|
||||||
name='label',
|
name='label',
|
||||||
field=models.CharField(help_text='A simple identifier for this action.', max_length=255, verbose_name='Label'),
|
field=models.CharField(
|
||||||
|
help_text='A simple identifier for this action.',
|
||||||
|
max_length=255, verbose_name='Label'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -4,18 +4,26 @@ from django.db import migrations
|
|||||||
|
|
||||||
|
|
||||||
def operation_add_full_path(apps, schema_editor):
|
def operation_add_full_path(apps, schema_editor):
|
||||||
WorkflowStateAction = apps.get_model('document_states', 'WorkflowStateAction')
|
WorkflowStateAction = apps.get_model(
|
||||||
|
app_label='document_states', model_name='WorkflowStateAction'
|
||||||
|
)
|
||||||
|
|
||||||
for workflow_state_action in WorkflowStateAction.objects.using(schema_editor.connection.alias).all():
|
for workflow_state_action in WorkflowStateAction.objects.using(schema_editor.connection.alias).all():
|
||||||
workflow_state_action.action_path = 'mayan.apps.{}'.format(workflow_state_action.action_path)
|
workflow_state_action.action_path = 'mayan.apps.{}'.format(
|
||||||
|
workflow_state_action.action_path
|
||||||
|
)
|
||||||
workflow_state_action.save()
|
workflow_state_action.save()
|
||||||
|
|
||||||
|
|
||||||
def operation_remove_full_path(apps, schema_editor):
|
def operation_remove_full_path(apps, schema_editor):
|
||||||
WorkflowStateAction = apps.get_model('document_states', 'WorkflowStateAction')
|
WorkflowStateAction = apps.get_model(
|
||||||
|
app_label='document_states', model_name='WorkflowStateAction'
|
||||||
|
)
|
||||||
|
|
||||||
for workflow_state_action in WorkflowStateAction.objects.using(schema_editor.connection.alias).all():
|
for workflow_state_action in WorkflowStateAction.objects.using(schema_editor.connection.alias).all():
|
||||||
workflow_state_action.action_path = workflow_state_action.action_path.replace('mayan.apps.', '')
|
workflow_state_action.action_path = workflow_state_action.action_path.replace(
|
||||||
|
'mayan.apps.', ''
|
||||||
|
)
|
||||||
workflow_state_action.save()
|
workflow_state_action.save()
|
||||||
|
|
||||||
|
|
||||||
@@ -27,6 +35,7 @@ class Migration(migrations.Migration):
|
|||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
migrations.RunPython(
|
migrations.RunPython(
|
||||||
operation_add_full_path, reverse_code=operation_remove_full_path
|
code=operation_add_full_path,
|
||||||
|
reverse_code=operation_remove_full_path
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import uuid
|
import uuid
|
||||||
@@ -7,8 +6,6 @@ from django.db import models, migrations
|
|||||||
from django.core.files.storage import FileSystemStorage
|
from django.core.files.storage import FileSystemStorage
|
||||||
from django.utils.encoding import force_text
|
from django.utils.encoding import force_text
|
||||||
|
|
||||||
import mayan.apps.documents.models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|
||||||
|
|
||||||
def make_existing_documents_not_stubs(apps, schema_editor):
|
def operation_make_existing_documents_not_stubs(apps, schema_editor):
|
||||||
Document = apps.get_model('documents', 'Document')
|
Document = apps.get_model(app_label='documents', model_name='Document')
|
||||||
|
|
||||||
for document in Document.objects.using(schema_editor.connection.alias).all():
|
for document in Document.objects.using(schema_editor.connection.alias).all():
|
||||||
document.is_stub = False
|
document.is_stub = False
|
||||||
@@ -27,5 +26,5 @@ class Migration(migrations.Migration):
|
|||||||
),
|
),
|
||||||
preserve_default=True,
|
preserve_default=True,
|
||||||
),
|
),
|
||||||
migrations.RunPython(make_existing_documents_not_stubs),
|
migrations.RunPython(code=operation_make_existing_documents_not_stubs),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user