summaryrefslogtreecommitdiff
path: root/django/contrib/contenttypes/views.py
AgeCommit message (Collapse)Author
2025-04-02Fixed #36267 -- Fixed contenttypes shortcut() view crash with an invalid ↵Ahmed Nassar
object_id for a UUIDField pk.
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2019-06-28Fixed #30400 -- Improved typography of user facing strings.Jon Dufresne
Thanks Claude Paroz for assistance with translations.
2018-06-21Fixed #18620 -- Made ContentTypes shortcut view prefer current site if ↵Paulo
available. Thanks Mike Tigas (mtigas) for the initial patch.
2017-11-06Fixed #28776 -- Fixed a/an/and typos in docs and comments.Дилян Палаузов
2017-09-07Reverted "Fixed #27818 -- Replaced try/except/pass with contextlib.suppress()."Tim Graham
This reverts commit 550cb3a365dee4edfdd1563224d5304de2a57fda because try/except performs better.
2017-06-28Fixed #27818 -- Replaced try/except/pass with contextlib.suppress().Mads Jensen
2017-02-27Imported django.http classes instead of django.http.Asif Saifuddin Auvi
2017-02-07Converted usage of ugettext* functions to their gettext* aliasesClaude Paroz
Thanks Tim Graham for the review.
2017-01-18Refs #23919 -- Removed encoding preambles and future importsClaude Paroz
2016-04-16Fixed #26085 -- Fixed contenttypes shortcut() view crash with a null fk to Site.dani poni
Thanks Fabien Schwob for the initial patch.
2015-03-25Renamed Field.rel attribute to remote_fieldAnssi Kääriäinen
Field.rel is now deprecated. Rel objects have now also remote_field attribute. This means that self == self.remote_field.remote_field. In addition, made the Rel objects a bit more like Field objects. Still, marked ManyToManyFields as null=True.
2014-10-01Fixed #15089 -- Allowed contrib.sites to lookup the current site based on ↵Tim Graham
request.get_host(). Thanks Claude Paroz, Riccardo Magliocchetti, and Damian Moore for contributions to the patch.
2014-03-03Fixed #16727 -- Added protocol-relative URL support to ↵Thomas Sorrel
contenttypes.views.shortcut.
2014-02-01Suppressed the `if Site._meta.installed` pattern.Aymeric Augustin
The purpose of this construct is to test if the django.contrib.sites application is installed. But in Django 1.9 it will be forbidden to import the Site model when the django.contrib.sites application isn't installed. No model besides Site used this pattern. Refs #21719, #21923.
2014-01-26Moved RequestSite and get_current_site.Aymeric Augustin
Following the app-loading refactor, these objects must live outside of django.contrib.sites.models because they must be available without importing the django.contrib.sites.models module when django.contrib.sites isn't installed. Refs #21680. Thanks Carl and Loic for reporting this issue.
2013-10-31Started attackign the next flake8 violationAlex Gaynor
2013-10-15Fixed #7603 -- Added a 'scheme' property to the HttpRequest objectUnai Zalakain
`HttpRequest.scheme` is `https` if `settings.SECURE_PROXY_SSL_HEADER` is appropriately set and falls back to `HttpRequest._get_scheme()` (a hook for subclasses to implement) otherwise. `WSGIRequest._get_scheme()` makes use of the `wsgi.url_scheme` WSGI environ variable to determine the request scheme. `HttpRequest.is_secure()` simply checks if `HttpRequest.scheme` is `https`. This provides a way to check the current scheme in templates, for example. It also allows us to deal with other schemes. Thanks nslater for the suggestion.
2013-05-17Replaced an antiquated pattern.Aymeric Augustin
Thanks Lennart Regebro for pointing it out.
2012-06-07Fixed #18269 -- Applied unicode_literals for Python 3 compatibility.Claude Paroz
Thanks Vinay Sajip for the support of his django3 branch and Jannis Leidel for the review.
2012-02-04Fixed #17458 -- Marked Http404 error messages for translation. Thanks, ↵Jannis Leidel
Claude Paroz. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17447 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-01-02Fixed #8997 -- Prevented the contenttypes `shortcut` view to hide errors ↵Julien Phalip
occurring inside the `get_absolute_url()` method. Thanks to Rob for the report and to joshlory, Aymeric Augustin and Claude Paroz for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17328 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-06Fixed #14414 -- Improved contenttypes shortcut() view to check that the ↵Adrian Holovaty
ContentType has a model_class(). Thanks, subsume git-svn-id: http://code.djangoproject.com/svn/django/trunk@13994 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-04Fixed #14386, #8960, #10235, #10909, #10608, #13845, #14377 - standardize ↵Luke Plant
Site/RequestSite usage in various places. Many thanks to gabrielhurley for putting most of this together. Also to bmihelac, arthurk, qingfeng, hvendelbo, petr.pulc@s-cape.cz, Hraban for reports and some initial patches. The patch also contains some whitespace/PEP8 fixes. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13980 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-19Fixed #10927 - Content Types shortcut view throws 500s instead of 404sLuke Plant
Thanks to Jeremy Dunck/Alex Gaynor for the patch git-svn-id: http://code.djangoproject.com/svn/django/trunk@11917 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-10Moved the bulk of the shortcut() function in django/views/defaults.py to a ↵Adrian Holovaty
new module, django/contrib/contenttypes/views.py. As a result, django/views/defaults.py no longer relies on django.contrib.contenttypes. Of course, the shortcut() function is still available in the former module, for backwards compatibility. See the new FutureBackwardsIncompatibleChanges wiki page. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9001 bcc190cf-cafb-0310-a4f2-bffc1f526a37