from django.conf import settings
from django.db import models

class InlistItem(models.Model):
    text = models.CharField(max_length=255, default='')
    user = models.ForeignKey(settings.AUTH_USER_MODEL)

    def __str__(self):
        return self.text

    class Meta:
        unique_together = ('text', 'user')

from django.conf import settings
from django.db import models

class InlistItem(models.Model):
    text = models.CharField(max_length=255, default='')
    user = models.ForeignKey(settings.AUTH_USER_MODEL)

    def __str__(self):
        return self.text

    class Meta:
        unique_together = ('text', 'user')
        ordering = ('pk',)

Add explicit ordering to inlist items
Add explicit ordering to inlist items

  from django.conf import settings
  from django.db import models
  
  class InlistItem(models.Model):
      text = models.CharField(max_length=255, default='')
      user = models.ForeignKey(settings.AUTH_USER_MODEL)
  
      def __str__(self):
          return self.text
  
      class Meta:
          unique_together = ('text', 'user')
+         ordering = ('pk',)
  
Add explicit ordering to inlist items
## Code Before:
from django.conf import settings
from django.db import models

class InlistItem(models.Model):
    text = models.CharField(max_length=255, default='')
    user = models.ForeignKey(settings.AUTH_USER_MODEL)

    def __str__(self):
        return self.text

    class Meta:
        unique_together = ('text', 'user')

## Instruction:
Add explicit ordering to inlist items
## Code After:
from django.conf import settings
from django.db import models

class InlistItem(models.Model):
    text = models.CharField(max_length=255, default='')
    user = models.ForeignKey(settings.AUTH_USER_MODEL)

    def __str__(self):
        return self.text

    class Meta:
        unique_together = ('text', 'user')
        ordering = ('pk',)
