Remove verbose_name and add documentation

This commit is contained in:
Zach Taylor 2020-10-20 15:02:45 -05:00
parent 2c5e1e6602
commit aaaa813b9b
2 changed files with 8 additions and 3 deletions

View file

@ -27,7 +27,7 @@ class Migration(migrations.Migration):
('modified', models.DateTimeField(auto_now=True, verbose_name='Modified')),
('required', models.BooleanField(default=False, verbose_name='Required')),
('display_order', models.PositiveIntegerField(default=1, verbose_name='Display order')),
('entity_ct', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='attribute_entities', to='contenttypes.ContentType', verbose_name='Belongs to')),
('entity_ct', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='attribute_entities', to='contenttypes.ContentType')),
],
options={
'ordering': ['name'],

View file

@ -189,9 +189,14 @@ class Attribute(models.Model):
null = True,
blank = True,
on_delete = models.PROTECT,
related_name = 'attribute_entities',
verbose_name = _('Belongs to')
related_name = 'attribute_entities'
)
"""
This field allows you to specify a foreign key to a content type.
This would be useful, for example, if you wanted an attribute to apply only to one entity.
In that case, you could filter by content type in the :meth:`~eav.registry.EavConfig.get_attributes`
method of that entity's config.
"""
enum_group = models.ForeignKey(
EnumGroup,