New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added #19414 -- Admin registration decorator #599
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Removed poor PHP references
Thank-you Daniele Procida for the first draft and shaibi, Aymeric, and others for the reviews.
…resence of a wider variety of code errors. Thanks goes to contributor with Trac user 'berto' for the patch.
…Windows. Thanks Hourann Bosci for the patch.
…t models. This documents the behavior introduced by cc337a7, which is BACKWARDS INCOMPATIBLE for any attempt to invoke a method on a manager using the abstract class as the calling class (e.g., AbstractBase.objects.do_something()) Thanks to mhsparks for the report.
…tom User models. Thanks to gcc for the report.
This makes it easier to make a ModelBackend-compliant (with regards to permissions) User model. Thanks to cdestigter for the report about the relationship between ModelBackend and permissions, and to the many users on django-dev that contributed to the discussion about mixins.
… the User model. Thanks to un33k for the report.
…orm. Refs #19368, and the fix introduced in 27f8129.
The code was dead-code since 2006.
The trim argument was used by split_exclude() only to trim the last join from the given lookup. It is cleaner to just trim the last part from the lookup in split_exclude() directly so that there is no need to burden add_filter() with the logic needed for only split_exclude().
This is a rather large refactoring. The "lookup traversal" code was splitted out from the setup_joins. There is now names_to_path() method which does the lookup traveling, the actual work of setup_joins() is calling names_to_path() and then adding the joins found into the query. As a side effect it was possible to remove the "process_extra" functionality used by genric relations. This never worked for left joins. Now the extra restriction is appended directly to the join condition instead of the where clause. To generate the extra condition we need to have the join field available in the compiler. This has the side-effect that we need more ugly code in Query.__getstate__ and __setstate__ as Field objects aren't pickleable. The join trimming code got a big change - now we trim all direct joins and never trim reverse joins. This also fixes the problem in django#10790 which was join trimming in null filter cases.
Thanks Tim Graham for reporting this issue and testing the fix.
The OmniGraffle source file is included for future use.
Thanks Valentin Lorentz for the report and the suggested fix.
Thanks colinnkeenan for the suggestion.
Cleaned up the implementation of base convert_values() a little, and made sure it accepts None as a value for numeric fields. There are no tests attached. The reason is that not all of the convert_values() accept None as a value for numeric fields (for example sqlite3.convert_values()). The reason the base convert_values() needs to accept None is that this situation might arise in custom compilers for 3rd party backends. It is easy to keep the convert_values() working, so lets do that.
Thanks to Simon Charette for report.
merged in 9851484 - thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I added a decorator that registers Model/ModelAdmin pairs with AdminSites. I mostly followed how the AdminSite.register method currently does this.