title: Adding Parameters to Existing Django Model Fields
body: <blockquote>
  <p>Note: there is <a href="https://stackoverflow.com/questions/20679057/adding-custom-attributes-to-django-model-field">another thread</a> on a similar problem, but this question is more detailed and the answer mentioned in the post above is not satisfactory (elaborated below)</p>
  </blockquote>
  <p>I was trying to create a custom Django model field, where the new field will essentially be the same as a <code>CharField</code> but has an <em>additional boolean attribute</em> -- for now, just call it &quot;public.&quot;</p>
  <p>I have looked up <a href="https://stackoverflow.com/questions/20679057/adding-custom-attributes-to-django-model-field">this article</a>, but I don't like the method described as it required me to construct a model from scratch. That solution is a hassle considering the number of functions I must implement to add a parameter, per the <a href="https://docs.djangoproject.com/en/3.1/howto/custom-model-fields/#writing-a-field-subclass" rel="nofollow noreferrer">docs</a>.</p>
  <p>To clarify my objectives, I will like to declare this field as such:</p>
  <pre class="lang-py prettyprint-override"><code>somefield = BoolCharField(public=True, max_length=100, blank=True)
  # Note that public is NOT a default CharField attribute
  </code></pre>
  <p>The documentation stated that I can extend new fields from existing ones, but <a href="https://docs.djangoproject.com/en/3.1/howto/custom-model-fields/#changing-a-custom-field-s-base-class" rel="nofollow noreferrer">the process</a> isn't elaborated. Can anyone please provide me with an <strong>example</strong> of how I should implement my field?</p>
  <p><a href="https://github.com/django/django/blob/master/django/db/models/fields/__init__.py#L1002" rel="nofollow noreferrer">This</a> is the source code of CharField in case anybody needs a reference.</p>
  <p><strong>Update</strong></p>
  <p>I had a look at overriding the default <code>__init__</code> method. Here's what the documentation suggests:</p>
  <pre class="lang-py prettyprint-override"><code>from django.db import models
  
  class HandField(models.Field):
      def __init__(self, *args, **kwargs):
          kwargs['max_length'] = 104
          super().__init__(*args, **kwargs)
  </code></pre>
  <p>However, the docs didn't specify how exactly overriding works in this case (e.g. where should I throw in <em>an additional attribute</em> and what methods I must include), which made me post this question.</p>
  <p>Again, as I have been stuck for quite some time, I'd prefer examples instead of concepts.</p>