Django CustomField inheritance from models.CharField -- unexpected keyword argument
<p>My application needs few attributes that are required for the fields, so I went and followed the code to create <a href="https://docs.djangoproject.com/en/1.10/howto/custom-model-fields/" rel="nofollow">custom fields</a>. </p>

<p>This is my CustomCharacterField:</p>

<pre><code>class CustomCharField(models.CharField):
    def __int__(self, success_order=None, *args, **kwargs):
        self.success_order = success_order
        super(CustomCharField, self).__int__( *args, **kwargs)

    def get_success_order(self):
        return int(self.success_order)


    def deconstruct(self):
        name, path, args, kwargs = super(CustomCharField, self).deconstruct()
        del kwargs["success_order"]
        return name, path, args, kwargs
</code></pre>

<p>Here is my models.py </p>

<pre><code>class NameModel(models.Model):

     name = fields.CustomCharField(max_length=250, unique=True, success_order=1)
</code></pre>

<p>Here is the traceback:</p>

<pre><code> File "/home/kt/Documents/phc/phc/Forms/models.py", line 204, in &lt;module&gt;
   class SchemeModel(models.Model):
  File "/home/kt/Documents/phc/phc/Forms/models.py", line 220, in SchemeModel
    scheme_name = fields.CustomCharField(verbose_name="Scheme", max_length=250, unique=True, success_order=1)
  File "/usr/local/lib/python3.4/dist-packages/django/db/models/fields/__init__.py", line 1072, in __init__
    super(CharField, self).__init__(*args, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'success_order'
</code></pre>

<p>I think you just have a typo here - <code>def __int__</code> should be <code>def __init__</code>, and the <code>super(...).__int__(..)</code> call should be <code>super(...).__init__(..)</code>.</p>

python django postgresql django-models