Skip to content

Commit

Permalink
Honouring limit_choices_to
Browse files Browse the repository at this point in the history
Was overriding any limit_choices_to options set on ForeignKey and
ManyToManyField when forcing to only show draft items.
  • Loading branch information
johnsensible committed Aug 30, 2011
1 parent 81ddb1b commit a147db9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion publish/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
VERSION = (0, 3, 4)
VERSION = (0, 3, 5)
__version__ = '.'.join(map(str, VERSION))
3 changes: 2 additions & 1 deletion publish/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ def _draft_queryset(db_field, kwargs):
# see if we need to filter the field's queryset
model = db_field.rel.to
if issubclass(model, Publishable):
kwargs['queryset'] = model._default_manager.draft()
kwargs['queryset'] = model._default_manager.draft() \
.complex_filter(db_field.rel.limit_choices_to)

def attach_filtered_formfields(admin_class):
# class decorator to add in extra methods that
Expand Down

0 comments on commit a147db9

Please sign in to comment.