title: RecursionError : maximum recursion depth exceeded while calling a Python object
body: <p>I am getting an error in admin console while trying to open a model . How to fix it</p>
  <p>Model.py</p>
  <pre><code>class TbSysEmailconfig(models.Model):
      id = models.ForeignKey('self', models.DO_NOTHING, db_column='Id', primary_key=True)  # Field name made lowercase.
      emailtemplateid = models.ForeignKey(TbMasEmailtemplate, models.DO_NOTHING, db_column='EmailTemplateId')
      emailfromname = models.CharField(db_column='EmailFromName', max_length=100, blank=True, null=True)
      emailfrom = models.CharField(db_column='EmailFrom', max_length=100)
      credential = models.CharField(db_column='Credential', max_length=100)
      password = models.CharField(db_column='Password', max_length=100)
      post = models.IntegerField(db_column='Post', blank=True, null=True)
      host = models.CharField(db_column='Host', max_length=100)
      priority = models.CharField(db_column='Priority', max_length=100, blank=True, null=True)
      maximumday = models.IntegerField(db_column='MaximumDay', blank=True, null=True)
      maximumminute = models.IntegerField(db_column='MaximumMinute', blank=True, null=True)
      systemid = models.IntegerField(db_column='SystemId')
      partfiletemplate = models.CharField(db_column='PartFileTemplate', max_length=500, blank=True, null=True)
      comment = models.CharField(db_column='Comment', max_length=1000, blank=True, null=True)
      ismaildefault = models.SmallIntegerField(db_column='IsMailDefault')
      maildefault = models.CharField(db_column='MailDefault', max_length=4000, blank=True, null=True)
      createddate = models.DateTimeField(db_column='CreatedDate')
      createdbyuserid = models.IntegerField(db_column='CreatedByUserId')
      updateddate = models.DateTimeField(db_column='UpdatedDate')
      updatedbyuserid = models.IntegerField(db_column='UpdatedByUserId')
      delflag = models.SmallIntegerField(db_column='DelFlag')
  
      class Meta:
          db_table = 'TB_SYS_EmailConfig'
  </code></pre>
  <p>admin.py</p>
  <pre><code>from django.contrib import admin
  from .model import TbSysEmailconfig 
  #Modifire 
  admin.site.register(TbSysEmailconfig) 
  </code></pre>
  <p><a href="https://i.stack.imgur.com/SqxCl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SqxCl.png" alt="enter image description here" /></a></p>
  <p>When I select some item
  it show this error</p>
  <p><a href="https://i.stack.imgur.com/Tku7R.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Tku7R.png" alt="enter image description here" /></a></p>