Iacopo Spalletti
0950478fcd
Update usage of databases instead of multidb
2020-08-14 16:49:51 +02:00
Chris Glass
76871e3863
Fix warnings
...
This is a little uncertain - while it does fix warnings I'm not sure the
removed assertion were actually useful in checking the behavior, and I'm
not certain how to recreate the assertion without using the depracated
path.
2020-08-14 16:32:18 +02:00
Chris Glass
6be20c14be
Fix PY3 reference in tests
...
We only ever build for py3 now, the compat reference was useless.
2020-08-14 11:05:32 +02:00
Bastien Vallet
b6921baede
Add support for Django 3.1
2020-08-05 10:39:48 +02:00
Bastien Vallet
68605ba2ba
[compat] Remove PY2 compat artefacts
...
- No need to specific types
- Remove __future__ imports
2020-08-04 14:49:40 +02:00
Bastien Vallet
85469082d0
Remove python_2_unicode_compatible method
2020-08-04 14:38:15 +02:00
Diederik van der Boor
c8463b1520
Fix PolymorphicInlineModelAdmin media jquery include for Django 2.0+
...
As Django changed the media query usage, jquery needs to be included
explicitly as well
2019-07-15 22:11:59 +02:00
Diederik van der Boor
db864cd8a8
Corrected black code wrapping when lines had long comments.
2019-07-15 18:10:05 +02:00
Diederik van der Boor
6af023dafd
Added unit test for refresh_from_db()
2019-07-15 17:56:53 +02:00
Diederik van der Boor
407679895f
Fixed import error in the admin due to isort
2019-07-15 10:19:10 +02:00
Diederik van der Boor
59c020ee50
Reformat all files with isort and black
2019-07-15 09:50:15 +02:00
Diederik van der Boor
8c8a920433
Remove dead/unused/unreachable get_first_user_defined_manager() code in metaclass
2019-07-12 18:14:40 +02:00
Diederik van der Boor
49f89ffb21
Fix random unit test failing due to model ordering
2019-07-12 17:53:16 +02:00
Diederik van der Boor
8fb8f47fb0
Fix compatibility with Django 3.0 alpha
...
Removed django.utils.six dependency, copied the parts we still need for
Python 2 compatibility.
2019-07-12 17:39:59 +02:00
Diederik van der Boor
c160556639
Merge PR #259 logic in a Django compatible way
2019-07-12 12:12:04 +02:00
Diederik van der Boor
17e41c4f7f
Rewrite translate_polymorphic_field_path() avoid closures
...
Inspired by PR #259 to look at this
2019-07-12 12:12:04 +02:00
Diederik van der Boor
f769ed7568
Fix dealing with missing derived table data with new prefetching code
2019-07-12 10:01:40 +02:00
Diederik van der Boor
3d9587acfb
Merge PR #353
2019-07-12 09:45:21 +02:00
Diederik van der Boor
4f89a879c0
Add tests for missing content types
2019-07-12 09:43:11 +02:00
Diederik van der Boor
ec3fb34f08
Merge pull request #365 from ghost/fix/37-subclass-selector-on-abstract-proxy-models
...
#37 : Fix model subclass ___ selector for abstract/proxy models
2019-07-11 22:12:24 +02:00
Diederik van der Boor
25f4dbb9cd
Restore single if-statement of PR #369 change
2019-07-11 22:10:42 +02:00
Diederik van der Boor
a1c779a295
Merge pull request #369 from marksweb/fix/202
...
Raise `PolymorphicTypeInvalid` instead of cause `TypeError`
2019-07-11 22:09:14 +02:00
Diederik van der Boor
02a7530e83
Merge pull request #370 from ShaheedHaque/srh_issue_367_update_extra_views
...
Restore compatibility with current versions of extra-views (issue #367 ).
2019-07-11 22:04:58 +02:00
Diederik van der Boor
f9492a12a8
Merge pull request #371 from tumb1er/replace_iterable_class
...
replace iterable class in qs.non_polymorphic
2019-07-11 22:03:07 +02:00
gtors
f06a02a3d0
Issue #373 : Fix bug with get_real_instances on empty base_result_objects
2019-07-11 21:59:46 +02:00
Diederik van der Boor
26fac56e31
Squash Merge PR #379 for Django 2.2 support
...
Author: Asif Saif Uddin <auvipy@gmail.com>
Author: jeff <jeff@mighty.com>
2019-07-11 21:57:46 +02:00
Andrey Zelenchuk
11208cedf8
Fix bug #392 "Inline model admin: wrong hiding of add button"
2019-07-11 21:42:24 +02:00
Diederik van der Boor
622e1e780b
Fix media-combining in formsets on Django 2.2
2019-07-11 21:38:33 +02:00
tumb1er
c565ae101a
replace iterable class in qs.non_polymorphic
2018-11-28 17:23:00 +03:00
Shaheed Haque
26b0eefa3a
Restore compatibility with current versions of extra-views (issue #367 ).
2018-11-24 12:49:26 +00:00
Mark Walker
3d9ac45cec
Correct the docstring for the invalid test.
2018-11-22 20:12:48 +00:00
Mark Walker
fd9d0fa2b8
Raise exception instead of cause `TypeError` when `polymorphic_ctype_id` is invalid.
2018-11-22 20:05:57 +00:00
Lukasz Zdun
14b31bed4c
#37 : Fix model subclass ___ selector for abstract/proxy models
2018-09-29 09:16:16 +02:00
Diederik van der Boor
9042fdd689
Replace instance_of OR query with IN statement
2018-08-24 11:16:30 +02:00
Diederik van der Boor
374afc3eac
Fixed Django 2.1 error due to missing use_required_attribute=False for empty forms
...
This attribute is supported as of Django 1.10, so adding it without
conditional Django version checks.
Fixes #360
2018-08-23 17:18:43 +02:00
Diederik van der Boor
5f50aa1dca
fix test warnings about \d+ escape
2018-08-23 14:24:32 +02:00
Markus Grimm
0f6352d74d
Added test
2018-08-09 09:13:48 +02:00
Markus Grimm
6040e9891a
Fix prefetch_related behavior
2018-06-28 15:10:43 +02:00
Diederik van der Boor
ff57aa57a3
include test for missing Meta.manager_inheritance_from_future
2018-02-05 13:31:00 +01:00
Diederik van der Boor
ea53b995a1
Enforce `manager_inheritance_from_future` on every model
2018-02-05 13:26:54 +01:00
Diederik van der Boor
a6aa95c07e
Fixed internal usage of deprecated `base_objects`
...
Reverted the change in f898f80594 that
also replaces the internal `base_objects` with `.non_polymorphic()`.
That also changed which querysets was used. Use a clean queryset
instead that has no select-related/prefetch information, etc.. like
previous versions did.
2018-02-05 13:00:23 +01:00
Diederik van der Boor
852ecf6ea9
Turn the manager inheritance error into a warning.
...
Not all projects have queryset issues, for example the class could be a
leaf that doesn't get inherited further.
class PolymorphicModel
class ContentItem
class TextItem <-- gets error, but it's the leaf anyway.
2018-02-05 10:19:18 +01:00
Diederik van der Boor
f898f80594
Fixed unwanted manager replacement in Django 1.11 projects.
...
Django 1.11 uses the old manager inheritance system, unless it's
overwritten with manager_inheritance_from_future. With a class layout
like:
PolymorphicModel (abstract)
PolymorphicMPTTModel (abstract)
GenericCustomer (concrete, has objects = ...)
CustomerGroupBase (abstract, has objects = ...)
Partner (concrete, no manager)
BranchPartner (concrete, no manager)
The last level gets a normal Django Manager instead of the polymorphic
manager. Because the PolymorphicModel had a base_objects manager, this
was typically used as _default_manager. Now that the default manager is
no longer affected, it's also easier to detect why the "objects" doesn't
get the proper manager type. Using "manager_inheritance_from_future" is
recommended instead to have both the right behavior and forward
Django 2.x compatibility.
2018-02-04 13:22:51 +01:00
Diederik van der Boor
f7c9df935f
move _polymorphic_iterator to PolymorphicModelIterable as there is no second compatibility code path anymore
2018-01-22 15:22:27 +01:00
Diederik van der Boor
9d651a1cdb
Fix the add_media() hack for Django 2.0
2018-01-18 15:45:18 +01:00
Charlie Denton
ed40b9e3e2
Use assertRegex to ignore object IDs
...
Sometimes the tests failed because these objects had IDs that differed
from expectations. As the IDs are not relevant to this test, I have
replaced the exact string match with a regex match that accepts any ID.
2018-01-17 22:02:19 +00:00
Charlie Denton
ca13180a61
Clean up unrequired compat import
2018-01-16 10:54:33 +00:00
Charlie Denton
3f6d94139c
Remove unused function in tests
2018-01-16 10:54:33 +00:00
Charlie Denton
e2bf741d5d
Remove models that are not referenced in tests
...
This silences one instance of the warning that's being printed in tests
for versions of Django before 2.0:
> RemovedInDjango20Warning: Managers from concrete parents will soon
> qualify as default managers if they appear before any other managers
> in the MRO.
2018-01-16 10:53:35 +00:00
Charlie Denton
120520e44d
Fix `add_media` util for Django 2.0
...
Neither `add_css` nor `add_js` exist in Django 2.0 because the method
for adding `Media` classes together has changed.
Ref: c19b56f633
2018-01-16 10:53:34 +00:00