PEP8 Cleanups (471 warnings).

This commit is contained in:
Roberto Rosario
2015-09-17 21:34:27 -04:00
parent 2b97f4a72f
commit df417f562c
16 changed files with 907 additions and 47 deletions

View File

@@ -23,8 +23,9 @@ class Migration(migrations.Migration):
),
(
'name', models.CharField(
help_text='Internal name used to reference this index.',
unique=True, max_length=64, verbose_name='Name'
help_text='Internal name used to reference this '
'index.', unique=True, max_length=64,
verbose_name='Name'
)
),
(
@@ -35,8 +36,8 @@ class Migration(migrations.Migration):
),
(
'enabled', models.BooleanField(
default=True,
help_text='Causes this index to be visible and updated when document data changes.',
default=True, help_text='Causes this index to be '
'visible and updated when document data changes.',
verbose_name='Enabled'
)
),
@@ -112,21 +113,23 @@ class Migration(migrations.Migration):
),
(
'expression', models.CharField(
help_text='Enter a python string expression to be evaluated.',
max_length=128, verbose_name='Indexing expression'
help_text='Enter a python string expression to be '
'evaluated.', max_length=128,
verbose_name='Indexing expression'
)
),
(
'enabled', models.BooleanField(
default=True,
help_text='Causes this node to be visible and updated when document data changes.',
default=True, help_text='Causes this node to be '
'visible and updated when document data changes.',
verbose_name='Enabled'
)
),
(
'link_documents', models.BooleanField(
default=False,
help_text='Check this option to have this node act as a container for documents and not as a parent for further nodes.',
default=False, help_text='Check this option to have '
'this node act as a container for documents and not '
'as a parent for further nodes.',
verbose_name='Link documents'
)
),

View File

@@ -15,8 +15,8 @@ class Migration(migrations.Migration):
model_name='index',
name='slug',
field=models.SlugField(
null=True, max_length=128, blank=True,
help_text='This values will be used by other apps to reference this index.',
null=True, max_length=128, blank=True, help_text='This values '
'will be used by other apps to reference this index.',
unique=True, verbose_name='Slug'
),
preserve_default=True,

View File

@@ -15,9 +15,9 @@ class Migration(migrations.Migration):
model_name='index',
name='slug',
field=models.SlugField(
default='', max_length=128,
help_text='This values will be used by other apps to reference this index.',
unique=True, verbose_name='Slug'
default='', max_length=128, help_text='This values will be '
'used by other apps to reference this index.', unique=True,
verbose_name='Slug'
),
preserve_default=False,
),

View File

@@ -15,8 +15,10 @@ class Migration(migrations.Migration):
model_name='indextemplatenode',
name='expression',
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/)",
max_length=128, verbose_name='Indexing expression'
help_text="Enter a template to render. Use Django's default "
"templating language (https://docs.djangoproject.com/en/1.7/"
"ref/templates/builtins/)", max_length=128,
verbose_name='Indexing expression'
),
preserve_default=True,
),

View File

@@ -1,6 +1,5 @@
from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.contrib import messages
from django.core.exceptions import PermissionDenied
from django.core.urlresolvers import reverse, reverse_lazy

View File

@@ -16,13 +16,19 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='documentversionsignature',
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,
),
migrations.AlterField(
model_name='documentversionsignature',
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,
),
]

View File

@@ -22,7 +22,9 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='document',
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,
),
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

View File

@@ -616,6 +616,7 @@ class DocumentTypeFilename(models.Model):
def __str__(self):
return self.filename
@python_2_unicode_compatible
class DocumentPage(models.Model):
"""

View File

@@ -163,6 +163,7 @@ class DocumentVersionTestCase(TestCase):
def test_revert_version(self):
self.assertEqual(self.document.versions.count(), 1)
# Needed by MySQL as milliseconds value is not store in timestamp field
time.sleep(1)
with open(TEST_DOCUMENT_PATH) as file_object:

View File

@@ -16,11 +16,33 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='Folder',
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)),
('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)),
(
'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
)
),
(
'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={
'ordering': ('title',),

View File

@@ -61,9 +61,10 @@ class Migration(migrations.Migration):
),
(
'inclusion', models.CharField(
default='&',
help_text='The inclusion is ignored for the first item.',
max_length=16, choices=[('&', 'and'), ('|', 'or')]
default='&', help_text='The inclusion is ignored for '
'the first item.', max_length=16, choices=[
('&', 'and'), ('|', 'or')
]
)
),
(

View File

@@ -18,18 +18,18 @@ class Migration(migrations.Migration):
blank=True, help_text='The parser will reformat the value '
'entered to conform to the expected format.', max_length=64,
verbose_name='Parser',
choices=[
(
b'metadata.validators.DateAndTimeValidator',
b'metadata.validators.DateAndTimeValidator'
), (
b'metadata.validators.DateValidator',
b'metadata.validators.DateValidator'
), (
b'metadata.validators.TimeValidator',
b'metadata.validators.TimeValidator'
)
]
choices=[
(
b'metadata.validators.DateAndTimeValidator',
b'metadata.validators.DateAndTimeValidator'
), (
b'metadata.validators.DateValidator',
b'metadata.validators.DateValidator'
), (
b'metadata.validators.TimeValidator',
b'metadata.validators.TimeValidator'
)
]
), preserve_default=True,
),
migrations.AlterField(

View File

@@ -12,7 +12,6 @@ from django.template import VariableDoesNotExist, Variable
from django.template.defaulttags import URLNode
from django.utils.encoding import smart_str, smart_unicode
from django.utils.http import urlencode, urlquote
from django.utils.translation import ugettext_lazy as _
from acls.models import AccessControlList
from common.utils import return_attrib

View File

@@ -13,10 +13,23 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='StatisticResult',
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')),
('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={
'verbose_name': 'Statistics result',