Skip to content

Support views with no model #56

@stevelacey

Description

@stevelacey

Worf currently raises ImproperlyConfigured if model is set to the default value of None, but None should probably be supported.

django.core.exceptions.ImproperlyConfigured: Model is not set on ...

If you set model to something else like False it then falls down when trying to build the filterset:

AttributeError: 'bool' object has no attribute '__name__'

Supplying your own queryset via get_queryset or response via get both bypass the need for a model which is handy in certain cases, currently the only way to suppress the error is to pass a model e.g. the django.db.models.Model abstract, even though it isn't used for anything meaningful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions