carltongibson / neapolitan

Quick CRUD views for Django
https://noumenal.es/neapolitan/
MIT License
413 stars 30 forks source link

Add option to exclude roles from get_urls #45

Closed WoosterInitiative closed 1 week ago

WoosterInitiative commented 1 month ago

Intead of explicitly choosing which roles to include, get all except for those that have been excluded with exclude.

CRUDView.get_urls(exclude=[Role.LIST])

Will raise exception if both roles and exclude are provided. exclude is a named parameter.

carltongibson commented 1 month ago

FWIW a comprehension will give you want you're looking for without the need for the extra option...

roles=[r for r in Role if r != Role.LIST]