| Age | Commit message (Collapse) | Author |
|
Added update_or_create to RelatedManager, ManyRelatedManager and
GenericRelatedObjectManager.
Added missing get_or_create to GenericRelatedObjectManager.
|
|
This is a reliqua from the early days of the modeltests/regressiontests era.
|
|
Generic Foreign Keys can't be used as lhs in lookups for historical
reasons. Django 1.6 gave a FieldDoesNotExist exception when using GFKs
as lhs in lookups, but due to regression caused by lookup refactor patch
(20bab2cf9d02a5c6477d8aac066a635986e0d3f3) the exception type was
changed to AttributeError.
It might be a good idea to add support for gfk__exact and gfk__in lookups
later on.
Thanks to glicerinu@gmail.com for the report. The code in this commit
was written by Tim Graham.
|
|
#18586.
|
|
Since assignments on M2M or reverse FK descriptors is composed of a `clear()`,
followed by an `add()`, `clear()` could potentially affect the value of the
assigned queryset before the `add()` step; pre-evaluating it solves the problem.
This patch fixes the issue for ForeignRelatedObjectsDescriptor,
ManyRelatedObjectsDescriptor, and ReverseGenericRelatedObjectsDescriptor.
It completes 6cb6e1 which addressed ReverseManyRelatedObjectsDescriptor.
|
|
GenericRelation now supports an optional related_query_name argument.
Setting related_query_name adds a relation from the related object back to
the content type for filtering, ordering and other query operations.
Thanks to Loic Bistuer for spotting a couple of important issues in
his review.
|
|
It contained models, forms and admin objects causing undesirable
import side effects. Refs #16368.
Thanks to Ramiro, Carl and Loïc for the review.
|
|
Signed-off-by: Jason Myers <jason@jasonamyers.com>
|
|
|
|
|
|
|
|
|
|
Thanks SamBull for the report.
|
|
|
|
method
Thanks mattaustin for the report and Pablo Recio (pyriku) for the patch.
|
|
refs #20429
Thanks Simon Charette for the report and review.
|
|
not have a default value
Thanks to Collin Anderson for the suggestion and Tim Graham for
reviewing the patch.
|
|
Should be unneeded with Python 2.7 and up.
Added some unicode_literals along the way.
|
|
Thanks Fak3 for the suggestion.
|
|
Allows a `GenericForeignKey` to reference proxy models. The default
for `for_concrete_model` is `True` to keep backwards compatibility.
Also added the analog `for_concrete_model` kwarg to
`generic_inlineformset_factory` to provide an API at the form level.
|
|
Gives much nicer errors when it fails.
|
|
Added a test, the issue was already fixed (likely by the patch
for #19385).
|
|
added '__all__' shortcut
This also updates all dependent functionality, including modelform_factory
and modelformset_factory, and the generic views `ModelFormMixin`,
`CreateView` and `UpdateView` which gain a new `fields` attribute.
|
|
return a QuerySet.
|
|
|