Skip to content

Commit

Permalink
Merge pull request #13 from seawolf42/fix/no-related-names-necessary-…
Browse files Browse the repository at this point in the history
…on-external-fields

Fix/no related names necessary on external fields
  • Loading branch information
seawolf42 committed Jun 7, 2018
2 parents a0c1c9a + 6532cd3 commit 80d05c3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions lookup_tables/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def __init__(self, table_ref, *args, **kwargs):
kwargs['to'] = 'lookup_tables.LookupTableItem'
kwargs['on_delete'] = db_models.PROTECT
kwargs['limit_choices_to'] = self.get_lookuptableitem_choices
kwargs['related_name'] = '+'
super(LookupTableItemField, self).__init__(*args, **kwargs)

def deconstruct(self):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

setup(
name='django-lookup-tables',
version='0.11.0',
version='0.11.1',
packages=find_packages(),
include_package_data=True,
license='MIT License',
Expand Down
1 change: 1 addition & 0 deletions tests/test_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def test_kwargs_includes_foreign_key_requisite_values(self, mock_fk_init):
to='lookup_tables.LookupTableItem',
on_delete=db_models.PROTECT,
limit_choices_to=item.get_lookuptableitem_choices,
related_name='+',
)

@mock.patch('django.db.models.ForeignKey.__init__')
Expand Down

0 comments on commit 80d05c3

Please sign in to comment.