Changes between Version 8 and Version 9 of QuerysetRefactorBranch
- Timestamp:
- Mar 21, 2008, 9:38:20 AM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
QuerysetRefactorBranch
v8 v9 1 1 = The queryset-refactor branch = 2 2 3 (Up to date as of 14March, 2008)3 (Up to date as of 22 March, 2008) 4 4 5 5 This branch contains a major refactoring of the {{{django.db.models.query.QuerySet}}} class to fix a group of SQL problems and make SQL generation easier for database backends requiring customization. … … 19 19 At the moment, the branch should be fairly usable for people wishing to test (with the exception of the Oracle backend, as noted below). It is not appropriate for production usage. Some of the new features, such as model inheritance still have rough edges or are incomplete, but all the porting work is complete and code that fixed existing bugs should all work. There are still some internal changes that need to be made prior to merging with trunk, so any code that tries to rely on internal methods may need to change before the next release. 20 20 21 Bug reports against code notlisted in the [#Workinprogress work in progress] section should be filed in Trac. Please take some extra effort to check for duplicates first.21 Bug reports against code '''not''' listed in the [#Workinprogress work in progress] section should be filed in Trac. Please take some extra effort to check for duplicates first. 22 22 23 23 Tickets of interest for this branch are marked with ''qs-rf'' (and ''qs-rf-fixed'' when fixed) in the keywords field in Trac. [http://code.djangoproject.com/query?status=new&status=assigned&status=reopened&keywords=%24qs-rf&order=priority This report] shows all the tickets being worked on (To view ''qs-rf'' with the ''qs-rf-fixed'' tagged tickets, [http://code.djangoproject.com/query?status=new&status=assigned&status=reopened&keywords=%7Eqs-rf&order=priority view this report]). … … 53 53 qs.extra(select={'a': ...}, order_by=('a',)) # New style 54 54 }}} 55 * Still on {{{extra(select=...)}}}... if you want to substitute parameters into these extra selection columns, use the {{{select_params}}} argument to {{{extra()}}}. The {{{params}}} arumgent is only applied to the extra where conditions. 56 * {{{select_related(False)}}} is no longer possible. Don't worry. You didn't know this existed, so you won't miss it. It was never part of the official API. 57 * There is a slight difference between these two filter statements 58 {{{ 59 #!python 60 qs.objects.filter(f1).filter(f2) 61 qs.objects.filter(f1, f2) 62 }}} 63 This difference only applies when `f1` and `f2` are referencing the same multi-valued relationship (a `ManyToManyField` or reverse `ForeignKey`). The first version allows filtering against different items from the relationship (things that match `f1` on one object in the related table as well as `f2` on another object in the related table), whereas the second version's filters will be applied to the same item. See the database API documentation section called "Lookups that span relationships" for details. 55 64 56 65 == Work in progress == … … 60 69 * Model inheritance has not been integrated into the admin. It's unclear at this time whether it will be worth doing this for existing admin or just port straight to newforms-admin. In any case, trying to use multi-table inheritance via the admin interface won't work. 61 70 * {{{OneToOneField}}} in the admin interface has similar problems. 62 * The Oracle backend has not been ported yet. This won't be particularly difficult, but it's still work to be done. Justin Bronn has started the ball rolling with a patch in #6161 that will be used as the base.63 * {{{exclude()}}} handling for particularly twisted filter combinations is still being bullet-proofed. It should work in almost all cases, but check the results carefully at the moment if you're doing something complex.