title: User-created Record Fields
body: <p>I am creating a web-app w/ Flask + Flask-WTF that has CRM-like features as a project. My current database (MongoDB) structure is I have:</p>
  <ol>
  <li>Users who can login,</li>
  <li>People who are assigned to users, and</li>
  <li>Records who are assigned to people.</li>
  </ol>
  <p>People have various fields to be filled out (Name, Phone Number, Email, etc).</p>
  <p>I want Users to be able to create custom fields for people. I am trying to plan out how to implement this from a database design perspective. My initial thoughts are to:</p>
  <ol>
  <li>For each field created, add a new field without a value for each People assigned to the user.</li>
  <li>Use a for-loop to dynamically create the form class by looping through each field-value in my database and excluding non-required ones.</li>
  <li>Use a for-loop to dynamically output the web form by looping through each field-value in my database and excluding non-required ones.</li>
  </ol>
  <p>Another idea I have is:</p>
  <ol>
  <li>For each field created, add the custom field, with a parentRecord equal to the User ID to a new MongoDB collection.</li>
  <li>Use a for-loop to create the form class &amp; web form dynamically, but I wouldn't need to exclude non-required ones as the only fields in the collection would be the custom ones, and wouldn't include any special data points that don't get displayed.</li>
  </ol>
  <p>So my questions are:</p>
  <ol>
  <li>Will my ideas above work?</li>
  <li>Which one is better?</li>
  <li>Is there a better way?</li>
  </ol>