# How to serialize user profiles without natural keys?

**URL:** <https://forum.djangoproject.com/t/how-to-serialize-user-profiles-without-natural-keys/34447>\
**Category:** Using the ORM\
**Created:** [September 3, 2024, 12:23am UTC](https://forum.djangoproject.com/t/how-to-serialize-user-profiles-without-natural-keys/34447 "2024-09-03T00:23:24Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Kakadus](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kakadus/32/23680_2.png) [@Kakadus](https://forum.djangoproject.com/u/Kakadus)\
**Post date:** [September 9, 2024, 8:12pm UTC](https://forum.djangoproject.com/t/how-to-serialize-user-profiles-without-natural-keys/34447/4 "2024-09-09T20:12:21Z")

</div>

Then, I think this the documentation needs to be adapted to include these assumptions, which are not obvious IMHO.  
Two paragraphs mention that the `USERNAME_FIELD` should be unique, unless using a custom authentication backend - we have a custom authentication backend.  
The docs do not mention that you have to implement a custom `natural_key`, if the username field is not unique and that `AbstractBaseUser` should not be used if there is no suitable unique group of fields for this `natural_key` implementation.

IMHO this is a major limitation, unnecessarily forcing users to re-implement `AbstractBaseUser`.

---

_[View the full topic](https://forum.djangoproject.com/t/how-to-serialize-user-profiles-without-natural-keys/34447)._
