Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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']
 
PREVIOUS NEXT
Tagged: #django #model #meta #ordering #multiple #ordering
ADD COMMENT
Topic
Name
6+2 =