Changes between Initial Version and Version 1 of Ticket #31083
- Timestamp:
- Dec 12, 2019, 7:57:16 AM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #31083 – Description
initial v1 3 3 Given this class: 4 4 5 ``` 5 {{{ 6 6 from django.contrib.sites.models import Site 7 7 … … 10 10 Site, on_delete=models.CASCADE, primary_key=True, related_name="detail" 11 11 ) 12 ``` 12 }}} 13 14 13 15 14 16 The following does not work: 15 17 16 ``` 18 {{{ 17 19 Site.objects.select_related("detail").get_current(request) 18 20 > AttributeError: 'QuerySet' object has no attribute 'get_current' 19 ``` 21 }}} 20 22 21 23 We could add support for something like this: 22 24 23 ``` 25 {{{ 24 26 Site.objects.get_current(request, select_related=["detail"]) 25 ``` 27 }}} 26 28 27 29 Which would allow the user to pass through any custom `Site` extensions without having to re-write the code in the `Site` manager. Given the use of `SITE_CACHE` inside of `SiteManager`, it seems like making this addition to its API would be a good step.