Allow filter_fieldsets to take either ModelAdmin or fieldsets directly

Review Request #9053 — Created July 5, 2017 and submitted

Information

Djblets
release-0.10.x
50f66b3...

Reviewers

Previously, you had to specify the actual ModelAdmin class to retrieve
fieldsets from. This is no longer the case and the fieldsets themselves
can be passed instead.

The documentation for what the function does has also been improved.

Tested with /r/9056/.

Description From Last Updated

The latest diff revision seems to include some other changes.

daviddavid

W293 blank line contains whitespace

reviewbotreviewbot

W293 blank line contains whitespace

reviewbotreviewbot

ValueError is probably appropriate here.

daviddavid

We should probably verify that admin.fieldsets exists and is iterable.

daviddavid

It's probably slightly better to use hasattr here.

daviddavid
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

brennie
david
  1. 
      
  2. djblets/forms/fieldsets.py (Diff revision 2)
     
     
    Show all issues

    ValueError is probably appropriate here.

  3. djblets/forms/fieldsets.py (Diff revision 2)
     
     
     
    Show all issues

    We should probably verify that admin.fieldsets exists and is iterable.

  4. 
      
brennie
brennie
david
  1. 
      
  2. Show all issues

    The latest diff revision seems to include some other changes.

  3. 
      
brennie
david
  1. 
      
  2. djblets/forms/fieldsets.py (Diff revision 5)
     
     
    Show all issues

    It's probably slightly better to use hasattr here.

  3. 
      
brennie
Review request changed
Status:
Completed
Change Summary:
Pushed to release-0.10.x (6c8424f)