Skip to content

ModelInfoViewSet

Overview

This viewset is for providing metadata about models, including fields, actions, and permissions to front-end clients. This is a read-only viewset.

You should be able to list all models, and get information about a specific model.

Effectively, this is a custom model viewset for content types.

urls using this viewset should provide the app_label and model as kwargs. ie: ```py path('model-info/<str:app_label>/<str:model>/', ModelInfoViewSet.as_view(), name='model-info')


## get_object {#get_object}

Returns the object the view is displaying.

You may want to override this if you need to provide non-standard
queryset lookups.  Eg if objects are referenced using multiple
keyword arguments in the url conf.

### Signature {#get_object-signature}

`get_object(self)`

#### Parameters {#get_object-parameters}

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| self |  | yes |  |

### Source {#get_object-source}

`server/vueda/info/viewsets.py:76`

## get_queryset {#get_queryset}

Get the list of items for this view.
This must be an iterable, and may be a queryset.
Defaults to using `self.queryset`.

This method should always be used rather than accessing `self.queryset`
directly, as `self.queryset` gets evaluated only once, and those results
are cached for all subsequent requests.

You may want to override this if you need to provide different
querysets depending on the incoming request.

(Eg. return a list of items that is specific to the user)

### Signature {#get_queryset-signature}

`get_queryset(self)`

#### Parameters {#get_queryset-parameters}

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| self |  | yes |  |

### Source {#get_queryset-source}

`server/vueda/info/viewsets.py:73`

## initial {#initial}

Runs anything that needs to occur prior to calling the method handler.

### Signature {#initial-signature}

`initial(self, request, args, kwargs)`

#### Parameters {#initial-parameters}

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| self |  | yes |  |
| request |  | yes |  |
| args |  | yes |  |
| kwargs |  | yes |  |

### Source {#initial-source}

`server/vueda/info/viewsets.py:62`

## basename {#basename}

## description {#description}

## detail {#detail}

## name {#name}

## object {#object}

## queryset {#queryset}

## serializer_class {#serializer_class}

## suffix {#suffix}

## Source

`server/vueda/info/viewsets.py:43`

Documents matching: server v3.0.0a1.post1client v3.0.0-alpha.2