PEP8 Cleanups.
This commit is contained in:
@@ -14,11 +14,35 @@ class Migration(migrations.Migration):
|
||||
migrations.CreateModel(
|
||||
name='SmartLink',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('title', models.CharField(max_length=96, verbose_name='Title')),
|
||||
('dynamic_title', models.CharField(help_text='This expression will be evaluated against the current selected document.', max_length=96, verbose_name='Dynamic title', blank=True)),
|
||||
('enabled', models.BooleanField(default=True, verbose_name='Enabled')),
|
||||
('document_types', models.ManyToManyField(to='documents.DocumentType', verbose_name='Document types')),
|
||||
(
|
||||
'id', models.AutoField(
|
||||
verbose_name='ID', serialize=False, auto_created=True,
|
||||
primary_key=True
|
||||
)
|
||||
),
|
||||
(
|
||||
'title', models.CharField(
|
||||
max_length=96, verbose_name='Title'
|
||||
)
|
||||
),
|
||||
(
|
||||
'dynamic_title', models.CharField(
|
||||
help_text='This expression will be evaluated against the current selected document.',
|
||||
max_length=96, verbose_name='Dynamic title',
|
||||
blank=True
|
||||
)
|
||||
),
|
||||
(
|
||||
'enabled', models.BooleanField(
|
||||
default=True, verbose_name='Enabled'
|
||||
)
|
||||
),
|
||||
(
|
||||
'document_types', models.ManyToManyField(
|
||||
to='documents.DocumentType',
|
||||
verbose_name='Document types'
|
||||
)
|
||||
),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Smart link',
|
||||
@@ -29,14 +53,69 @@ class Migration(migrations.Migration):
|
||||
migrations.CreateModel(
|
||||
name='SmartLinkCondition',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('inclusion', models.CharField(default='&', help_text='The inclusion is ignored for the first item.', max_length=16, choices=[('&', 'and'), ('|', 'or')])),
|
||||
('foreign_document_data', models.CharField(help_text='This represents the metadata of all other documents.', max_length=128, verbose_name='Foreign document attribute')),
|
||||
('operator', models.CharField(max_length=16, choices=[('exact', 'is equal to'), ('iexact', 'is equal to (case insensitive)'), ('contains', 'contains'), ('icontains', 'contains (case insensitive)'), ('in', 'is in'), ('gt', 'is greater than'), ('gte', 'is greater than or equal to'), ('lt', 'is less than'), ('lte', 'is less than or equal to'), ('startswith', 'starts with'), ('istartswith', 'starts with (case insensitive)'), ('endswith', 'ends with'), ('iendswith', 'ends with (case insensitive)'), ('regex', 'is in regular expression'), ('iregex', 'is in regular expression (case insensitive)')])),
|
||||
('expression', models.TextField(help_text='This expression will be evaluated against the current document.', verbose_name='Expression')),
|
||||
('negated', models.BooleanField(default=False, help_text='Inverts the logic of the operator.', verbose_name='Negated')),
|
||||
('enabled', models.BooleanField(default=True, verbose_name='Enabled')),
|
||||
('smart_link', models.ForeignKey(related_name='conditions', verbose_name='Smart link', to='linking.SmartLink')),
|
||||
(
|
||||
'id', models.AutoField(
|
||||
verbose_name='ID', serialize=False, auto_created=True,
|
||||
primary_key=True
|
||||
)
|
||||
),
|
||||
(
|
||||
'inclusion', models.CharField(
|
||||
default='&',
|
||||
help_text='The inclusion is ignored for the first item.',
|
||||
max_length=16, choices=[('&', 'and'), ('|', 'or')]
|
||||
)
|
||||
),
|
||||
(
|
||||
'foreign_document_data', models.CharField(
|
||||
help_text='This represents the metadata of all other documents.',
|
||||
max_length=128,
|
||||
verbose_name='Foreign document attribute'
|
||||
)
|
||||
),
|
||||
(
|
||||
'operator', models.CharField(
|
||||
max_length=16, choices=[
|
||||
('exact', 'is equal to'),
|
||||
('iexact', 'is equal to (case insensitive)'),
|
||||
('contains', 'contains'),
|
||||
('icontains', 'contains (case insensitive)'),
|
||||
('in', 'is in'), ('gt', 'is greater than'),
|
||||
('gte', 'is greater than or equal to'),
|
||||
('lt', 'is less than'),
|
||||
('lte', 'is less than or equal to'),
|
||||
('startswith', 'starts with'),
|
||||
('istartswith', 'starts with (case insensitive)'),
|
||||
('endswith', 'ends with'),
|
||||
('iendswith', 'ends with (case insensitive)'),
|
||||
('regex', 'is in regular expression'),
|
||||
('iregex', 'is in regular expression (case insensitive)')
|
||||
]
|
||||
)
|
||||
),
|
||||
(
|
||||
'expression', models.TextField(
|
||||
help_text='This expression will be evaluated against the current document.',
|
||||
verbose_name='Expression'
|
||||
)
|
||||
),
|
||||
(
|
||||
'negated', models.BooleanField(
|
||||
default=False, help_text='Inverts the logic of the operator.',
|
||||
verbose_name='Negated'
|
||||
)
|
||||
),
|
||||
(
|
||||
'enabled', models.BooleanField(
|
||||
default=True, verbose_name='Enabled'
|
||||
)
|
||||
),
|
||||
(
|
||||
'smart_link', models.ForeignKey(
|
||||
related_name='conditions', verbose_name='Smart link',
|
||||
to='linking.SmartLink'
|
||||
)
|
||||
),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Link condition',
|
||||
|
||||
@@ -219,7 +219,9 @@ class SmartLinkConditionListView(SingleObjectListView):
|
||||
return {
|
||||
'hide_link': True,
|
||||
'object': self.get_smart_link(),
|
||||
'title': _('Conditions for smart link: %s') % self.get_smart_link(),
|
||||
'title': _(
|
||||
'Conditions for smart link: %s'
|
||||
) % self.get_smart_link(),
|
||||
}
|
||||
|
||||
def get_smart_link(self):
|
||||
|
||||
Reference in New Issue
Block a user