Repository: django/django
File: tests/admin_views/models.py (Python)

Code before:

    @admin.display(ordering="order")
    def some_order(self):
        return self.order


class AdminOrderedAdminMethod(models.Model):
    order = models.IntegerField()
    stuff = models.CharField(max_length=200)


class AdminOrderedCallable(models.Model):
    order = models.IntegerField()
    stuff = models.CharField(max_length=200)


class Report(models.Model):
    title = models.CharField(max_length=100)

    def __str__(self):
        return self.title


class MainPrepopulated(models.Model):
    name = models.CharField(max_length=100)
    pubdate = models.DateTimeField()  # DateTimeField will render a <fieldset>.
    status = models.CharField(
        max_length=20,
        choices=(("option one", "Option One"), ("option two", "Option Two")),
    )
    slug1 = models.SlugField(blank=True)
    slug2 = models.SlugField(blank=True)
    slug3 = models.SlugField(blank=True, allow_unicode=True)


class RelatedPrepopulated(models.Model):
    parent = models.ForeignKey(MainPrepopulated, models.CASCADE)
    name = models.CharField(max_length=75)
    fk = models.ForeignKey("self", models.CASCADE, blank=True, null=True)
    m2m = models.ManyToManyField("self", blank=True)
    pubdate = models.DateField()
    status = models.CharField(
        max_length=20,
        choices=(("option one", "Option One"), ("option two", "Option Two")),
    )
    slug1 = models.SlugField(max_length=50)
    slug2 = models.SlugField(max_length=60)


class UnorderedObject(models.Model):
    """

Review comment (bug):
It seems like the existing tests are failing(`admin_views.tests.SeleniumTests.test_populate_existing_object`) due to changing the field type. 
Of course, we could fix the tests, but instead of changing the field type, what do you think about using the `Course` model that was previously created for the fieldsets tests?
I think we would just need to add `fieldsets` to the `ModelAdmin`.

https://github.com/django/django/blob/68d110f1fe593b7a368486c41cd062563a74fe0a/tests/admin_views/models.py#L626-L639

Code after:
    stuff = models.CharField(max_length=200)


class AdminOrderedModelMethod(models.Model):
    order = models.IntegerField()
    stuff = models.CharField(max_length=200)

    @admin.display(ordering="order")
    def some_order(self):
        return self.order


class AdminOrderedAdminMethod(models.Model):
    order = models.IntegerField()
    stuff = models.CharField(max_length=200)


class AdminOrderedCallable(models.Model):
    order = models.IntegerField()
    stuff = models.CharField(max_length=200)


class Report(models.Model):
    title = models.CharField(max_length=100)

    def __str__(self):
        return self.title


class MainPrepopulated(models.Model):
    name = models.CharField(max_length=100)
    pubdate = models.DateField()
    status = models.CharField(
        max_length=20,
        choices=(("option one", "Option One"), ("option two", "Option Two")),
    )
    slug1 = models.SlugField(blank=True)
    slug2 = models.SlugField(blank=True)
    slug3 = models.SlugField(blank=True, allow_unicode=True)


class RelatedPrepopulated(models.Model):
    parent = models.ForeignKey(MainPrepopulated, models.CASCADE)
    name = models.CharField(max_length=75)
    fk = models.ForeignKey("self", models.CASCADE, blank=True, null=True)
    m2m = models.ManyToManyField("self", blank=True)
    pubdate = models.DateField()
    status = models.CharField(
        max_length=20,
        choices=(("option one", "Option One"), ("option two", "Option Two")),
    )