title: Django Admin cannot find data that exists: 'Perhaps it was deleted?'
body: <p>I have a similar problem to this question:</p>
  
  <p><a href="https://stackoverflow.com/questions/49497987/tablename-with-id-some-id-doesnt-exist-perhaps-it-was-deleted-django-sqlite">Tablename with ID &quot;Some_ID&quot; doesn&#39;t exist. Perhaps it was deleted? Django Sqlite</a></p>
  
  <p>The issue only occurs with one particular model which is:</p>
  
  <pre><code>class Kinterms(models.Model):
      kin_category = models.TextField(blank=True, null=True)  # This field type is a guess.
      parameter = models.TextField(blank=True, null=True)  # This field type is a guess.
      term = models.TextField(blank=True, null=True)  # This field type is a guess.
      ipa_term = models.TextField(blank=True, null=True)  # This field type is a guess.
      alternative_address = models.TextField(blank=True, null=True)  # This field type is a guess.
      comment = models.TextField(blank=True, null=True)  # This field type is a guess.
      sourceid = models.TextField(db_column='sourceID', blank=True, null=True)  # Field name made lowercase. This field type is a guess.
      coder = models.TextField(blank=True, null=True)  # This field type is a guess.
      speaking = models.TextField(blank=True, null=True)  # This field type is a guess.
      kinbank_id = models.TextField(blank=True, null=True)  # This field type is a guess.
      glottocode = models.TextField(blank=True, null=True)  # This field type is a guess.
      row_id = models.TextField(unique=True, blank=True, primary_key = True)  # This field type is a guess.
  
      class Meta:
          managed = False
          db_table = 'kinterms'
  
      def __str__(self):
          return self.row_id
  </code></pre>
  
  <p>Which is displayed in the admin file as</p>
  
  <pre><code>from django.contrib import admin
  
  from .models import Kinterms, Metadata, Sources, Coder
  # Register your models here.
  admin.site.register(Kinterms)
  </code></pre>
  
  <p>As with the linked question, whenever I log into the admin site and click on a row for the Kinterms model I get returned to the admin home page with the banner 'Kinterms with ID "XXXX" doesn't exist. Perhaps it was deleted?" </p>
  
  <p>Recreating the DB doesn't fix the issue. I can manually find the values in the DB using the DB viewer. </p>
  
  <p>I have exactly the same set up for all other tables which work fine. The only difference I can note is that this table uses a number for the primary key where as the others are characters. Although they are all TextFields so I assumed this wouldn't matter. </p>
  
  <p>I am not entirely sure what to look for since there are no obvious errors occuring. So please let me know if there is any more information that could be useful. </p>