Answers for "django model meta ordering multiple ordering"

0

django model meta ordering multiple ordering

class Transaction(models.Model):
  	created_at = models.DateTimeField(
        default=timezone.now, null=True, blank=True
    )
	paid = models.DateTimeField(null=True, blank=True)

  	class Meta:
		ordering = ['-paid', '-created_at']
Posted by: Guest on January-19-2021

Python Answers by Framework

Browse Popular Code Answers by Language