# Django Users as choices in another model

**URL:** <https://forum.djangoproject.com/t/django-users-as-choices-in-another-model/36062>\
**Category:** Forms & APIs\
**Created:** [October 29, 2024, 7:27pm UTC](https://forum.djangoproject.com/t/django-users-as-choices-in-another-model/36062 "2024-10-29T19:27:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbhrfx9280](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/jbhrfx9280/32/15247_2.png) [@jbhrfx9280](https://forum.djangoproject.com/u/jbhrfx9280)\
**Post date:** [October 29, 2024, 7:27pm UTC](https://forum.djangoproject.com/t/django-users-as-choices-in-another-model/36062/1 "2024-10-29T19:27:11Z")

</div>

Django 5.1.1  
Python 3.12.4

I need to get all the Django username’s and use them as a choice field in model . I generally use  
user = request.user to get a user’s information but I need all users and use them in a choice class

```auto
class ManagerMessages(models.Model):
   class UserChoices(models.TextChoices):
           *Not sure what to put here*

    UserName= models.CharField(max_length=10, choices=UserChoices.choices)

```

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [October 29, 2024, 8:07pm UTC](https://forum.djangoproject.com/t/django-users-as-choices-in-another-model/36062/2 "2024-10-29T20:07:22Z")

</div>

Actually, the appropriate option here would be to change that field to be a ForeignKey to your User model.

Quoting directly from the Django docs for `choices` at: [Model field reference | Django documentation | Django](https://docs.djangoproject.com/en/5.1/ref/models/fields/#choices)

> Note that choices can be any sequence object – not necessarily a list or tuple. This lets you construct choices dynamically. But if you find yourself hacking [`choices`](https://docs.djangoproject.com/en/5.1/ref/models/fields/#django.db.models.Field.choices) to be dynamic, you’re probably better off using a proper database table with a [`ForeignKey`](https://docs.djangoproject.com/en/5.1/ref/models/fields/#django.db.models.ForeignKey). [`choices`](https://docs.djangoproject.com/en/5.1/ref/models/fields/#django.db.models.Field.choices) is meant for static data that doesn’t change much, if ever.
