mirror of
https://github.com/fastapi-users/fastapi-users.git
synced 2026-03-13 07:49:55 +08:00
Deployed 0f4cf0c to dev with MkDocs 1.4.2 and mike 1.1.2
This commit is contained in:
@@ -1255,6 +1255,10 @@
|
||||
<p class="admonition-title">Info</p>
|
||||
<p>The base class is configured to automatically create a <a href="https://roman-right.github.io/beanie/tutorial/defining-a-document/#indexes">unique index</a> on <code>id</code> and <code>email</code>.</p>
|
||||
</div>
|
||||
<div class="admonition info">
|
||||
<p class="admonition-title">Info</p>
|
||||
<p>If you want to add your own custom settings to your <code>User</code> document model - like changing the collection name - don't forget to let your inner <code>Settings</code> class inherit the pre-defined settings from <code>BeanieBaseUser</code> like this: <code>class Settings(BeanieBaseUser.Settings): # ...</code>! See Beanie's <a href="https://beanie-odm.dev/tutorial/defining-a-document/#settings">documentation on <code>Settings</code></a> for details.</p>
|
||||
</div>
|
||||
<h2 id="create-the-database-adapter">Create the database adapter<a class="headerlink" href="#create-the-database-adapter" title="Permanent link">¶</a></h2>
|
||||
<p>The database adapter of <strong>FastAPI Users</strong> makes the link between your database configuration and the users logic. It should be generated by a FastAPI dependency.</p>
|
||||
<div class="highlight"><pre><span></span><code><a id="__codelineno-2-1" name="__codelineno-2-1" href="#__codelineno-2-1"></a><span class="kn">import</span> <span class="nn">motor.motor_asyncio</span>
|
||||
|
||||
Reference in New Issue
Block a user