add a scope attribute to Attribute (#21769)

This commit is contained in:
Benjamin Dauvergne 2018-02-19 17:22:03 +01:00
parent 93cc7e363f
commit fcc3a92bff
3 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('authentic2', '0021_attribute_order'),
]
operations = [
migrations.AddField(
model_name='attribute',
name='scopes',
field=models.CharField(default=b'', help_text='scopes separated by spaces', max_length=256, verbose_name='scopes', blank=True),
),
]

View File

@ -151,6 +151,13 @@ class Attribute(models.Model):
verbose_name=_('searchable'),
blank=True, default=False)
scopes = models.CharField(
verbose_name=_('scopes'),
help_text=_('scopes separated by spaces'),
blank=True,
default='',
max_length=256)
order = models.PositiveIntegerField(
verbose_name=_('order'),
default=0)

View File

@ -87,6 +87,7 @@ class SerializerTests(TestCase):
'disabled': False,
'searchable': False,
'order': 0,
'scopes': '',
}
},
{