Django: TypeError: '<' not supported between instances (model objects)
问题 I'm trying to migrate my Django project from Python 2.7/Django 1.11 to Python 3.7/Django 2.1. I've found one issue and I want to understand its cause. I have 3 models in my project: class DeviceModel(models.Model): name = models.CharField(max_length=255) pirsh = models.CharField(max_length=255) def __str__(self): return self.name + " - " + self.pirsh class Device(models.Model): created_at = models.DateTimeField(auto_now_add=True) device_model = models.ForeignKey(DeviceModel, on_delete=models