Add new Django and Python compatibility functions.

Review Request #10251 — Created Oct. 21, 2018 and submitted

Information

Djblets
release-2.0.x
570294a...

Reviewers

The new djblets.util.compat.django.shortcuts module features a
version of render() that works with older and newer versions of
Django. Any existing calls to render() or render_to_response()
should be updated to use this.

The new djblets.util.compat.django.utils.functional provides a
backport of SimpleLazyObject, which supports more special functions
like __iter__, __contains__, and more. This is a drop-in replacement
for Django's SimpleLazyObject.

The new djblets.util.compat.python.past is intended to provide
re-implementations of old useful capabilities that have been removed
from Python 3.x. For now, it provides cmp, which Python 3 has removed
in favor of a hard-to-remember comparison expression. For readability,
consistency, and easier development, our version can be used in place of
that expression.

Made use of this in some pending code. These worked on Python 2.7,
3.5, and 3.6.

Description From Last Updated

typo: .oy -> .py

daviddavid

E501 line too long (82 > 79 characters)

reviewbotreviewbot

E501 line too long (96 > 79 characters)

reviewbotreviewbot

E501 line too long (83 > 79 characters)

reviewbotreviewbot

E501 line too long (82 > 79 characters)

reviewbotreviewbot

E501 line too long (83 > 79 characters)

reviewbotreviewbot

E501 line too long (82 > 79 characters)

reviewbotreviewbot

E501 line too long (80 > 79 characters)

reviewbotreviewbot

E303 too many blank lines (2)

reviewbotreviewbot

E501 line too long (81 > 79 characters)

reviewbotreviewbot

E501 line too long (82 > 79 characters)

reviewbotreviewbot

E501 line too long (81 > 79 characters)

reviewbotreviewbot

E501 line too long (82 > 79 characters)

reviewbotreviewbot

E303 too many blank lines (2)

reviewbotreviewbot

E501 line too long (82 > 79 characters)

reviewbotreviewbot

E731 do not assign a lambda expression, use a def

reviewbotreviewbot

E501 line too long (82 > 79 characters)

reviewbotreviewbot

E501 line too long (96 > 79 characters)

reviewbotreviewbot

E501 line too long (83 > 79 characters)

reviewbotreviewbot

E501 line too long (82 > 79 characters)

reviewbotreviewbot

E501 line too long (83 > 79 characters)

reviewbotreviewbot

E501 line too long (82 > 79 characters)

reviewbotreviewbot

E501 line too long (80 > 79 characters)

reviewbotreviewbot

E303 too many blank lines (2)

reviewbotreviewbot

E501 line too long (81 > 79 characters)

reviewbotreviewbot

E501 line too long (82 > 79 characters)

reviewbotreviewbot

E501 line too long (81 > 79 characters)

reviewbotreviewbot

E501 line too long (82 > 79 characters)

reviewbotreviewbot

E303 too many blank lines (2)

reviewbotreviewbot

E501 line too long (82 > 79 characters)

reviewbotreviewbot

E731 do not assign a lambda expression, use a def

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

david
  1. 
      
  2. Show all issues

    typo: .oy -> .py

  3. 
      
chipx86
Review request changed
Change Summary:

Fixed a typo in a referenced filename in a comment.

Commit:
a1c67e2713e8e69dd995fa90d8a566c11f6b9605
570294a3077f8569c15afaab99189cef3528ad5d

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-2.0.x (4e3119f)