---
url: "https://vueda.dev/v3/reference/api/py/vueda.user.models/TOTPDevice.md"
title: "TOTPDevice"
---

# TOTPDevice

## Overview

Stores a two-factor authentication device for a user. Links a ``django-allauth``
``Authenticator`` to a user and records the delivery method (TOTP app, SMS, or email)
along with the relevant contact detail (phone number or email address).

## `DoesNotExist` {#DoesNotExist}

The requested object does not exist

### Source {#DoesNotExist-source}

`server/vueda/user/models.py`

## `MultipleObjectsReturned` {#MultipleObjectsReturned}

The query returned multiple objects when only one was expected.

### Source {#MultipleObjectsReturned-source}

`server/vueda/user/models.py`

## `NotUpdated` {#NotUpdated}

The updated object no longer exists.

### Source {#NotUpdated-source}

`server/vueda/user/models.py`

## `email` {#email}

A wrapper for a deferred-loading field. When the value is read from this
object the first time, the query is executed.

### Signature {#email-signature}

`email(unknown)`

#### Parameters {#email-parameters}

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| <span id="email-param-unknown">unknown</span> |  | yes |  |  |

## `get_formatted_name` {#get_formatted_name}

Return the human-readable label for the authentication method.

### Signature {#get_formatted_name-signature}

`get_formatted_name(self)`

#### Parameters {#get_formatted_name-parameters}

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

#### Returns {#get_formatted_name-returns}

`str`

### Source {#get_formatted_name-source}

`server/vueda/user/models.py:229`

## `get_method_display` {#get_method_display}

Method descriptor with partial application of the given arguments
and keywords.

Supports wrapping existing descriptors and handles non-descriptor
callables as instance methods.

### Signature {#get_method_display-signature}

`get_method_display(unknown)`

#### Parameters {#get_method_display-parameters}

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| <span id="get_method_display-param-unknown">unknown</span> |  | yes |  |  |

## `id` {#id}

A wrapper for a deferred-loading field. When the value is read from this
object the first time, the query is executed.

### Signature {#id-signature}

`id(unknown)`

#### Parameters {#id-parameters}

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| <span id="id-param-unknown">unknown</span> |  | yes |  |  |

## `method` {#method}

A wrapper for a deferred-loading field. When the value is read from this
object the first time, the query is executed.

### Signature {#method-signature}

`method(unknown)`

#### Parameters {#method-parameters}

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| <span id="method-param-unknown">unknown</span> |  | yes |  |  |

## `pgh_event_model` {#pgh_event_model}

A descriptor for accessing the pgh_event_model field on a tracked model

### Signature {#pgh_event_model-signature}

`pgh_event_model(unknown)`

#### Parameters {#pgh_event_model-parameters}

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| <span id="pgh_event_model-param-unknown">unknown</span> |  | yes |  |  |

## `authenticator` {#authenticator}

Accessor to the related object on the forward side of a many-to-one or
one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example::

    class Child(Model):
        parent = ForeignKey(Parent, related_name='children')

``Child.parent`` is a ``ForwardManyToOneDescriptor`` instance.

## `authenticator_id` {#authenticator_id}

## `events` {#events}

Accessor to the related objects manager on the reverse side of a
many-to-one relation.

In the example::

    class Child(Model):
        parent = ForeignKey(Parent, related_name='children')

``Parent.children`` is a ``ReverseManyToOneDescriptor`` instance.

Most of the implementation is delegated to a dynamically defined manager
class built by ``create_reverse_many_to_one_manager()`` defined below.

## `formatted_name` {#formatted_name}

## `pgh_event_models` {#pgh_event_models}

## `phone_number` {#phone_number}

The descriptor for the phone number attribute on the model instance.
Returns a PhoneNumber when accessed so you can do stuff like::

    >>> instance.phone_number.as_international

Assigns a phone number object on assignment so you can do::

    >>> instance.phone_number = PhoneNumber(...)

or,

    >>> instance.phone_number = '+414204242'

## `user` {#user}

Accessor to the related object on the forward side of a many-to-one or
one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example::

    class Child(Model):
        parent = ForeignKey(Parent, related_name='children')

``Child.parent`` is a ``ForwardManyToOneDescriptor`` instance.

## `user_id` {#user_id}

## Source

`server/vueda/user/models.py:198`
