mirror of
https://github.com/django/django.git
synced 2025-10-04 07:46:37 +00:00
Fixed #24479 -- Added system check to prevent both ordering and order_wrt.
This commit is contained in:
parent
e304e13448
commit
966a29c2b8
5 changed files with 64 additions and 4 deletions
|
@ -100,6 +100,7 @@ class Options(object):
|
|||
self.verbose_name_plural = None
|
||||
self.db_table = ''
|
||||
self.ordering = []
|
||||
self._ordering_clash = False
|
||||
self.unique_together = []
|
||||
self.index_together = []
|
||||
self.select_on_save = False
|
||||
|
@ -234,6 +235,9 @@ class Options(object):
|
|||
if self.verbose_name_plural is None:
|
||||
self.verbose_name_plural = string_concat(self.verbose_name, 's')
|
||||
|
||||
# order_with_respect_and ordering are mutually exclusive.
|
||||
self._ordering_clash = bool(self.ordering and self.order_with_respect_to)
|
||||
|
||||
# Any leftover attributes must be invalid.
|
||||
if meta_attrs != {}:
|
||||
raise TypeError("'class Meta' got invalid attribute(s): %s" % ','.join(meta_attrs.keys()))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue