| Age | Commit message (Collapse) | Author |
|
This is a useful trick when Python 2 awaits byte strings and
Python 3 Unicode (regular) strings.
|
|
Thanks Preston Holmes for the patch.
|
|
|
|
xrange/range will be dealt with in a separate commit due to the huge
number of changes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The qs.bulk_create() method did not work with large batches together
with SQLite3. This commit adds a way to split the bulk into smaller
batches. The default batch size is unlimited except for SQLite3 where
the batch size is limited to 999 SQL parameters per batch.
Thanks to everybody who participated in the discussions at Trac.
|
|
The erroneous message was user visible in values_list() calls.
Thanks to ojii for report and review, and to antoviaque for the patch.
|
|
Cleared aggregations on add_date_select method so only distinct dates
are returned when dealing with a QuerySet that contained aggregations.
That would cause the query set to return repeated dates because it
would look for distinct (date kind, aggregation) pairs.
|
|
|
|
moons ago.
|
|
Revert of 08d521efa0. Refs #10547, #12121.
Thanks Michal Petrucha for the report.
|
|
|
|
Thanks to Simon Charette for noticing this.
|
|
At least Oracle needs parentheses in negated where conditions, even if
there is only single condition negated. Fixed this by reverting to old
logic in that part of as_sql() and adding a comment about this.
I did not investigate why the parentheses are needed. The original
offending commit was bd283aa844b04651b7c8b4e85f48c6dced1678f0.
|
|
Made sure the WhereNode.as_sql() handles various EmptyResultSet and
FullResultSet conditions correctly. Also, got rid of the FullResultSet
exception class. It is now represented by '', [] return value in the
as_sql() methods.
|
|
Thanks to harm for the report and comments.
|
|
When a FileField value has been saved, a new validation should not
regenerate a new filename when checking the length. Refs #9893.
|
|
This commit tackles a couple of issues. First, in certain cases there
were some mixups if field.attname or field.name should be deferred.
Field.attname is now always used.
Another issue tackled is a case where field is both deferred by
.only(), and selected by select_related. This case is now an error.
A lot of thanks to koniiiik (Michal Petrucha) for the patch, and
to Andrei Antoukh for review.
|
|
|
|
Thanks to ambv for the report
|
|
|
|
query when chained. Thanks, Jann Kleen.
|
|
Thanks Vinay Sajip for the support of his django3 branch and
Jannis Leidel for the review.
|
|
|
|
inherited model
Thanks to milosu for the report, tests and initial patch.
|
|
|
|
When generating error message in to_python, any unicode string
containing non-ascii characters triggered a UnicodeEncodeError for
most field types.
|
|
Generic cleanup and dead code removal in deferred model field loading
and model.__reduce__().
Also fixed an issue where if an inherited model with a parent field
chain parent_ptr_id -> id would be deferred loaded, then accessing
the id field caused caused a database query, even if the id field's
value is already loaded in the parent_ptr_id field.
|
|
When order_by causes new joins to be added to the query, the joins must
be LEFT OUTER joins for nullable relations, otherwise the order_by
could cause the results to be altered. This commit fixes the logic to
only promote new joins, previously all joins in the order_by lookup
path were promoted.
Thanks to Bruno Desthuilliers for spotting this corner case.
|
|
This was recently fixed for one-to-one relations; this patch adds
support for foreign keys. Thanks kaiser.yann for the report and
the initial version of the patch.
|
|
The new construct is also Python 3 compatible (where 'next' has
been renamed to '__next__').
|
|
Databases with update_can_self_select = False (MySQL for example)
generated non-necessary queries when saving a multitable inherited
model, and when the save resulted in update.
|
|
This is a preparation for unicode literals general usage in
Django (Python 3 compatibility).
|
|
after the full file name is generated by the storage class.
Thanks Refefer for the report, carsongee for the patch, and
everyone else involved in the discussion.
|
|
Added the ability to update only part of the model's fields in
model.save() by introducing a new kwarg "update_fields". Thanks
to all the numerous reviewers and commenters in the ticket
|
|
This new syntax for next() has been introduced in Python 2.6 and is
compatible with Python 3.
|
|
Fixed #18248 -- proxy models were added to included_inherited_models
in sql.query.Query. The variable is meant to be used for multitable
inheritance only. This mistake caused problems in situations where
proxy model's query was reused.
|
|
Fixed #17851 -- Added __lt__ and @total_ordering to models.Field,
made sure these work correctly on other objects than Field, too.
|
|
In Python 3, itertools.izip is not available any more (behaviour
integrated in standard zip).
|
|
Converted aware datetimes to the default time zone before using them
in the context of a DateField.
|
|
|
|
This makes the code easier to understand and may even have a benefit in memory usage (namedtuples instead of dicts). Thanks, lrekucki and akaariai
|
|
Thanks Clueless for the initial patch.
Note that unittest has been purposely left out (external package only used by Python 2.6).
|
|
|
|
Fixed #17957 -- when using Oracle and character fields, the fields
were set null = True to ease the handling of empty strings. This
caused problems when using multiple databases from different vendors,
or when the character field happened to be also a primary key.
The handling was changed so that NOT NULL is not emitted on Oracle
even if field.null = False, and field.null is not touched otherwise.
Thanks to bhuztez for the report, ramiro for triaging & comments,
ikelly for the patch and alex for reviewing.
|