mirror of
				https://github.com/django/django.git
				synced 2025-10-29 08:36:09 +00:00 
			
		
		
		
	Fixed #28917 -- Prevented Paginator's unordered warning on EmptyQuerySet.
Thanks carltongibson for the idea and weijunji for the initial patch.
This commit is contained in:
		
				
					committed by
					
						 Tim Graham
						Tim Graham
					
				
			
			
				
	
			
			
			
						parent
						
							93e721a0b8
						
					
				
				
					commit
					4d48ddd8f9
				
			| @@ -1100,8 +1100,10 @@ class QuerySet: | ||||
|     def ordered(self): | ||||
|         """ | ||||
|         Return True if the QuerySet is ordered -- i.e. has an order_by() | ||||
|         clause or a default ordering on the model. | ||||
|         clause or a default ordering on the model (or is empty). | ||||
|         """ | ||||
|         if isinstance(self, EmptyQuerySet): | ||||
|             return True | ||||
|         if self.query.extra_order_by or self.query.order_by: | ||||
|             return True | ||||
|         elif self.query.default_ordering and self.query.get_meta().ordering: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user