PEP8 Cleanups (471 warnings).
This commit is contained in:
@@ -23,8 +23,9 @@ class Migration(migrations.Migration):
|
|||||||
),
|
),
|
||||||
(
|
(
|
||||||
'name', models.CharField(
|
'name', models.CharField(
|
||||||
help_text='Internal name used to reference this index.',
|
help_text='Internal name used to reference this '
|
||||||
unique=True, max_length=64, verbose_name='Name'
|
'index.', unique=True, max_length=64,
|
||||||
|
verbose_name='Name'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
@@ -35,8 +36,8 @@ class Migration(migrations.Migration):
|
|||||||
),
|
),
|
||||||
(
|
(
|
||||||
'enabled', models.BooleanField(
|
'enabled', models.BooleanField(
|
||||||
default=True,
|
default=True, help_text='Causes this index to be '
|
||||||
help_text='Causes this index to be visible and updated when document data changes.',
|
'visible and updated when document data changes.',
|
||||||
verbose_name='Enabled'
|
verbose_name='Enabled'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
@@ -112,21 +113,23 @@ class Migration(migrations.Migration):
|
|||||||
),
|
),
|
||||||
(
|
(
|
||||||
'expression', models.CharField(
|
'expression', models.CharField(
|
||||||
help_text='Enter a python string expression to be evaluated.',
|
help_text='Enter a python string expression to be '
|
||||||
max_length=128, verbose_name='Indexing expression'
|
'evaluated.', max_length=128,
|
||||||
|
verbose_name='Indexing expression'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
'enabled', models.BooleanField(
|
'enabled', models.BooleanField(
|
||||||
default=True,
|
default=True, help_text='Causes this node to be '
|
||||||
help_text='Causes this node to be visible and updated when document data changes.',
|
'visible and updated when document data changes.',
|
||||||
verbose_name='Enabled'
|
verbose_name='Enabled'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
'link_documents', models.BooleanField(
|
'link_documents', models.BooleanField(
|
||||||
default=False,
|
default=False, help_text='Check this option to have '
|
||||||
help_text='Check this option to have this node act as a container for documents and not as a parent for further nodes.',
|
'this node act as a container for documents and not '
|
||||||
|
'as a parent for further nodes.',
|
||||||
verbose_name='Link documents'
|
verbose_name='Link documents'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ class Migration(migrations.Migration):
|
|||||||
model_name='index',
|
model_name='index',
|
||||||
name='slug',
|
name='slug',
|
||||||
field=models.SlugField(
|
field=models.SlugField(
|
||||||
null=True, max_length=128, blank=True,
|
null=True, max_length=128, blank=True, help_text='This values '
|
||||||
help_text='This values will be used by other apps to reference this index.',
|
'will be used by other apps to reference this index.',
|
||||||
unique=True, verbose_name='Slug'
|
unique=True, verbose_name='Slug'
|
||||||
),
|
),
|
||||||
preserve_default=True,
|
preserve_default=True,
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ class Migration(migrations.Migration):
|
|||||||
model_name='index',
|
model_name='index',
|
||||||
name='slug',
|
name='slug',
|
||||||
field=models.SlugField(
|
field=models.SlugField(
|
||||||
default='', max_length=128,
|
default='', max_length=128, help_text='This values will be '
|
||||||
help_text='This values will be used by other apps to reference this index.',
|
'used by other apps to reference this index.', unique=True,
|
||||||
unique=True, verbose_name='Slug'
|
verbose_name='Slug'
|
||||||
),
|
),
|
||||||
preserve_default=False,
|
preserve_default=False,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -15,8 +15,10 @@ class Migration(migrations.Migration):
|
|||||||
model_name='indextemplatenode',
|
model_name='indextemplatenode',
|
||||||
name='expression',
|
name='expression',
|
||||||
field=models.CharField(
|
field=models.CharField(
|
||||||
help_text="Enter a template to render. Use Django's default templating language (https://docs.djangoproject.com/en/1.7/ref/templates/builtins/)",
|
help_text="Enter a template to render. Use Django's default "
|
||||||
max_length=128, verbose_name='Indexing expression'
|
"templating language (https://docs.djangoproject.com/en/1.7/"
|
||||||
|
"ref/templates/builtins/)", max_length=128,
|
||||||
|
verbose_name='Indexing expression'
|
||||||
),
|
),
|
||||||
preserve_default=True,
|
preserve_default=True,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
from __future__ import absolute_import, unicode_literals
|
from __future__ import absolute_import, unicode_literals
|
||||||
|
|
||||||
from django.conf import settings
|
|
||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
from django.core.exceptions import PermissionDenied
|
from django.core.exceptions import PermissionDenied
|
||||||
from django.core.urlresolvers import reverse, reverse_lazy
|
from django.core.urlresolvers import reverse, reverse_lazy
|
||||||
|
|||||||
@@ -16,13 +16,19 @@ class Migration(migrations.Migration):
|
|||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='documentversionsignature',
|
model_name='documentversionsignature',
|
||||||
name='has_embedded_signature',
|
name='has_embedded_signature',
|
||||||
field=models.BooleanField(default=False, verbose_name='Has embedded signature'),
|
field=models.BooleanField(
|
||||||
|
default=False, verbose_name='Has embedded signature'
|
||||||
|
),
|
||||||
preserve_default=True,
|
preserve_default=True,
|
||||||
),
|
),
|
||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='documentversionsignature',
|
model_name='documentversionsignature',
|
||||||
name='signature_file',
|
name='signature_file',
|
||||||
field=models.FileField(storage=storage.backends.filebasedstorage.FileBasedStorage(), upload_to=document_signatures.models.upload_to, null=True, verbose_name='Signature file', blank=True),
|
field=models.FileField(
|
||||||
|
storage=storage.backends.filebasedstorage.FileBasedStorage(),
|
||||||
|
upload_to=document_signatures.models.upload_to, null=True,
|
||||||
|
verbose_name='Signature file', blank=True
|
||||||
|
),
|
||||||
preserve_default=True,
|
preserve_default=True,
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -22,7 +22,9 @@ class Migration(migrations.Migration):
|
|||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='document',
|
model_name='document',
|
||||||
name='is_stub',
|
name='is_stub',
|
||||||
field=models.BooleanField(default=True, verbose_name='Is stub?', editable=False),
|
field=models.BooleanField(
|
||||||
|
default=True, verbose_name='Is stub?', editable=False
|
||||||
|
),
|
||||||
preserve_default=True,
|
preserve_default=True,
|
||||||
),
|
),
|
||||||
migrations.RunPython(make_existing_documents_not_stubs),
|
migrations.RunPython(make_existing_documents_not_stubs),
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -616,6 +616,7 @@ class DocumentTypeFilename(models.Model):
|
|||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.filename
|
return self.filename
|
||||||
|
|
||||||
|
|
||||||
@python_2_unicode_compatible
|
@python_2_unicode_compatible
|
||||||
class DocumentPage(models.Model):
|
class DocumentPage(models.Model):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -163,6 +163,7 @@ class DocumentVersionTestCase(TestCase):
|
|||||||
def test_revert_version(self):
|
def test_revert_version(self):
|
||||||
self.assertEqual(self.document.versions.count(), 1)
|
self.assertEqual(self.document.versions.count(), 1)
|
||||||
|
|
||||||
|
# Needed by MySQL as milliseconds value is not store in timestamp field
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
with open(TEST_DOCUMENT_PATH) as file_object:
|
with open(TEST_DOCUMENT_PATH) as file_object:
|
||||||
|
|||||||
@@ -16,11 +16,33 @@ class Migration(migrations.Migration):
|
|||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='Folder',
|
name='Folder',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
(
|
||||||
('title', models.CharField(max_length=128, verbose_name='Title', db_index=True)),
|
'id', models.AutoField(
|
||||||
('datetime_created', models.DateTimeField(auto_now_add=True, verbose_name='Datetime created')),
|
verbose_name='ID', serialize=False, auto_created=True,
|
||||||
('documents', models.ManyToManyField(related_name='folders', verbose_name='Documents', to='documents.Document')),
|
primary_key=True
|
||||||
('user', models.ForeignKey(verbose_name='User', to=settings.AUTH_USER_MODEL)),
|
)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'title', models.CharField(
|
||||||
|
max_length=128, verbose_name='Title', db_index=True
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'datetime_created', models.DateTimeField(
|
||||||
|
auto_now_add=True, verbose_name='Datetime created'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'documents', models.ManyToManyField(
|
||||||
|
related_name='folders', verbose_name='Documents',
|
||||||
|
to='documents.Document'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'user', models.ForeignKey(
|
||||||
|
verbose_name='User', to=settings.AUTH_USER_MODEL
|
||||||
|
)
|
||||||
|
),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'ordering': ('title',),
|
'ordering': ('title',),
|
||||||
|
|||||||
@@ -61,9 +61,10 @@ class Migration(migrations.Migration):
|
|||||||
),
|
),
|
||||||
(
|
(
|
||||||
'inclusion', models.CharField(
|
'inclusion', models.CharField(
|
||||||
default='&',
|
default='&', help_text='The inclusion is ignored for '
|
||||||
help_text='The inclusion is ignored for the first item.',
|
'the first item.', max_length=16, choices=[
|
||||||
max_length=16, choices=[('&', 'and'), ('|', 'or')]
|
('&', 'and'), ('|', 'or')
|
||||||
|
]
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
|
|||||||
@@ -18,18 +18,18 @@ class Migration(migrations.Migration):
|
|||||||
blank=True, help_text='The parser will reformat the value '
|
blank=True, help_text='The parser will reformat the value '
|
||||||
'entered to conform to the expected format.', max_length=64,
|
'entered to conform to the expected format.', max_length=64,
|
||||||
verbose_name='Parser',
|
verbose_name='Parser',
|
||||||
choices=[
|
choices=[
|
||||||
(
|
(
|
||||||
b'metadata.validators.DateAndTimeValidator',
|
b'metadata.validators.DateAndTimeValidator',
|
||||||
b'metadata.validators.DateAndTimeValidator'
|
b'metadata.validators.DateAndTimeValidator'
|
||||||
), (
|
), (
|
||||||
b'metadata.validators.DateValidator',
|
b'metadata.validators.DateValidator',
|
||||||
b'metadata.validators.DateValidator'
|
b'metadata.validators.DateValidator'
|
||||||
), (
|
), (
|
||||||
b'metadata.validators.TimeValidator',
|
b'metadata.validators.TimeValidator',
|
||||||
b'metadata.validators.TimeValidator'
|
b'metadata.validators.TimeValidator'
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
), preserve_default=True,
|
), preserve_default=True,
|
||||||
),
|
),
|
||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ from django.template import VariableDoesNotExist, Variable
|
|||||||
from django.template.defaulttags import URLNode
|
from django.template.defaulttags import URLNode
|
||||||
from django.utils.encoding import smart_str, smart_unicode
|
from django.utils.encoding import smart_str, smart_unicode
|
||||||
from django.utils.http import urlencode, urlquote
|
from django.utils.http import urlencode, urlquote
|
||||||
from django.utils.translation import ugettext_lazy as _
|
|
||||||
|
|
||||||
from acls.models import AccessControlList
|
from acls.models import AccessControlList
|
||||||
from common.utils import return_attrib
|
from common.utils import return_attrib
|
||||||
|
|||||||
@@ -13,10 +13,23 @@ class Migration(migrations.Migration):
|
|||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='StatisticResult',
|
name='StatisticResult',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
(
|
||||||
|
'id', models.AutoField(
|
||||||
|
verbose_name='ID', serialize=False, auto_created=True,
|
||||||
|
primary_key=True
|
||||||
|
)
|
||||||
|
),
|
||||||
('slug', models.SlugField(verbose_name='Slug')),
|
('slug', models.SlugField(verbose_name='Slug')),
|
||||||
('datetime', models.DateTimeField(auto_now=True, verbose_name='Date time')),
|
(
|
||||||
('serialize_data', models.TextField(verbose_name='Data', blank=True)),
|
'datetime', models.DateTimeField(
|
||||||
|
auto_now=True, verbose_name='Date time'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'serialize_data', models.TextField(
|
||||||
|
verbose_name='Data', blank=True
|
||||||
|
)
|
||||||
|
),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'verbose_name': 'Statistics result',
|
'verbose_name': 'Statistics result',
|
||||||
|
|||||||
Reference in New Issue
Block a user