class QuerySet:
def order_by(self, *field_names, append=False, prepend=False
):
if append and prepend:
raise AssertionError('Can only append or prepend, not both')
assert self.query.can_filter(), \
"Cannot reorder a query once a slice has been taken."
obj = self._chain()
if not append and not prepend:
obj.query.clear_ordering(force_empty=False)
obj.query.add_ordering(*field_names,
prepend=
prepend
)
return obj
class Query:
def add_ordering(self, *ordering, prepend=False
):
if append and prepend:
raise AssertionError('Can only append or prepend, not both')
# ...
if ordering:
if prepend:
self.ordering = ordering + self.ordering
else:
self.order_by += ordering
# ...
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.--
To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscribe@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/c9279d82-6b81-42cb-8577-16004e623e3d%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscribe@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/d1258e72-93a0-4075-da65-9f09902845f1%40markusholtermann.eu.
For more options, visit https://groups.google.com/d/optout.
Can you please tell me where the issues of django are in GitHub ?
--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscribe@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/20171218233351.5e08ebc8.shai%40platonix.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscribe@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/20171223194238.1999df87.shai%40platonix.com.
For more options, visit https://groups.google.com/d/optout.