Commit Graph

209 Commits (137139f2bbfacfc9c90399d4c1b1b8413ea7cd5d)

Author SHA1 Message Date
Diederik van der Boor 009069a32b Avoid auto-proxying all methods to the queryset.
This is unwanted behavior, and django provides much better methods for
it instead. (PolymorphicQuerySet.as_manager() / PolymorphicManager.from_queryset()
2015-12-28 17:10:58 +01:00
Diederik van der Boor 9e2c11beb8 Replace __version__.py with __init__.py
Also fixes reporting in sentry.
2015-12-28 17:10:42 +01:00
Diederik van der Boor 5191b6c130 Also remove showfields imports from __init__.py
If we're to cause pain, let it be once.
2015-12-28 17:10:42 +01:00
Diederik van der Boor 50f21dfa43 Rename manager.py => managers.py for consistency 2015-12-28 17:10:42 +01:00
Diederik van der Boor 07242d210f Fix "Model" __ "_field" query support
Broken by 24e6b21204 for Django 1.9
upgrade
2015-12-28 16:19:27 +01:00
Diederik van der Boor b7431b2d06 Fix PEP8 block comment issues (E265) 2015-12-28 15:16:42 +01:00
Diederik van der Boor aaf06c71a5 Fix PEP8 whitespace issues
autopep8 -r polymorphic/ example/ -i
--select=E112,E113,E115,E116,E122,E123,E125,E127,E128,E201,E202,E203,E211,E225,E226,E227,E228,E231,E251,E261,E262,E271,E272,E273,E274,E301,E302,E303,E304,E309,E711,E713,W291,W293,W391
--exclude migrations,south_migrations

(line conditiation fixes: E123,E125,E122,E127,E128)
2015-12-28 15:16:29 +01:00
Jonas Haag 4da67a0fb6 Fix an issue with '.values()' queries 2015-12-16 10:31:36 -03:00
Jonas Haag 0b87a5ecc8 Fixed a Python >= 3.7 incompatibility (see PEP 479) 2015-12-16 10:31:36 -03:00
Jonas Haag ee2e0a95ea Extend comment about admin URL patching 2015-12-16 10:31:36 -03:00
Hugo Osvaldo Barrera fb32b97b37 Remove obsolete compatibility code comment 2015-12-16 10:31:36 -03:00
Hugo Osvaldo Barrera e73a4662c3 Prevent infinite redirection on django1.9
See here[1] as to why this is an issue, and why we can skip the avoided
code on django>=1.9.

[1]: https://docs.djangoproject.com/en/1.9/releases/1.9/#django-contrib-admin
2015-12-16 10:31:36 -03:00
Jonas Haag 6cf187b2de Fix Django < 1.8 compatibility 2015-12-16 10:31:36 -03:00
Jonas Haag 24e6b21204 Fix a handful of warnings and remove some unused compatibility code 2015-12-16 10:31:36 -03:00
Hugo Osvaldo Barrera adcad20b48 Update all tests (and runtests.py) 2015-12-16 10:31:36 -03:00
Hugo Osvaldo Barrera b996d1c377 Avoid broken references to declared_fieldset
Check if this attribute exists first, since it does not in recent django
versions.
2015-12-16 10:31:33 -03:00
Hugo Osvaldo Barrera ad5ce60158 Remove reference to obsolete request.REQUEST 2015-10-21 22:27:00 -03:00
Hugo Osvaldo Barrera 31bfe8d1e7 Remove deprecated django.conf.urls.patterns 2015-10-21 22:18:21 -03:00
Hugo Osvaldo Barrera c48d4f589b Don't import models and managers in __init__
This is deprecated as of django 1.8, and does not work as of django 1.9.
2015-10-21 22:11:06 -03:00
Gavin Wahl 0c940bd795 SingleRelatedObjectDescriptor was renamed in Django 1.9 2015-10-13 13:22:13 -06:00
Gonzalo Bustos 83eec48d27 add spanish translation 2015-10-12 11:44:01 -03:00
Diederik van der Boor c8973d1fba Fixed Python 2.6 tests, and fixed tox.ini from PR #162 for python 3 2015-10-01 14:35:34 +02:00
Diederik van der Boor ce4b9348ec Bump version to 0.7.2 to release a few minor bugfixes 2015-10-01 14:26:28 +02:00
Diederik van der Boor 2ffbd51844 Added as_manager() support for querysets 2015-10-01 14:26:28 +02:00
Diederik van der Boor d85664f0b7 Optimize PolymorphicModel attribute access, only use __getattribute__ hack when needed. 2015-10-01 14:03:33 +02:00
Diederik van der Boor fdf905d91b Merge pull request #156 from svleeuwen/patch-1
Fix Pickle exception when polymorphic model is cached
2015-10-01 14:02:12 +02:00
Tai Lee bcc39a9086 Raise Http404 if object does not exist. 2015-09-22 09:55:03 +10:00
Sander van Leeuwen ed55ceb7fa Fix Pickle exception when polymorphic model is cached
fixes issue #155
2015-09-04 16:51:22 +02:00
Diederik van der Boor 1979ee6079 Remove unused import after merging #139 2015-08-04 16:13:06 +02:00
Martin Maillard 941e447ed0 Use parent admin site class for child admin site
Using the ``AdminSite`` class directly can cause issues when the parent
model is registered with a custom admin site class.
2015-06-08 14:04:26 +02:00
Diederik van der Boor 7a29c3972c Bump version to 0.7.1 2015-04-30 11:40:14 +02:00
Diederik van der Boor 1ff5f148b6 Fixed Django 1.8 support for related field widgets.
The RelatedFieldWidgetWrapper tries to resolve the "change" url with
"__fk__" as ID value, which broke with our strict pk_regex
2015-04-30 11:39:13 +02:00
Diederik van der Boor 9d68dee7dd __version__.py: reference PEP 440 instead. 2015-04-30 11:35:34 +02:00
Diederik van der Boor 07e1ff90a8 Bump versions to 0.7 2015-04-08 14:08:47 +02:00
Diederik van der Boor 5f4e6e18ba Fix missing import 2015-04-08 13:49:10 +02:00
tyaslab 135feaf905 fixed 'source_expressions'
(cherry picked from commit 9a34a2a5017499bb12512b2387de49aa2c40fc88)
2015-04-08 13:44:35 +02:00
Diederik van der Boor 640461216b Merge pull request #127 from warrd/master
Issue with related_name in polymorphic_ctype field
2015-04-08 13:40:28 +02:00
Diederik van der Boor 9ef7ccb65e Fixed long/int issue for Python 3.
This closes #126 with a fix that won't degrate Python 2 code.
2015-04-08 13:38:26 +02:00
Diederik van der Boor 9efc5cfcb2 Merge pull request #124 from benkonrath/fix-admin-500-error
Don't remove '/' from id when it's not in the path
2015-04-08 13:35:25 +02:00
Diederik van der Boor 17c2445e39 Merge pull request #120 from theatlantic-pr/cleanup-test-noise
Conflicts:
	polymorphic/tests.py
2015-04-08 13:33:54 +02:00
Diederik van der Boor 2b78b92cc6 Merge pull request #121 from luisza/master
Fixed preserved filter for django 1.7
2015-04-08 13:25:17 +02:00
Diederik van der Boor c947c3dec1 Merge pull request #119 from theatlantic/child-model-custom-pk-bug
Bug with queryset results on base model where child model has a custom primary key
2015-04-08 13:09:35 +02:00
Diederik van der Boor d16d989e91 Merge pull request #118 from theatlantic/_default_manager-instance-fix
Set _default_manager directly on model_cls; don't use add_to_class()
2015-04-08 13:06:12 +02:00
Nick Ward 90933184e9 Modified polymorphic_ctype related_name to be valid 2015-03-11 16:33:19 +00:00
Ben Konrath 2a8a16edb8 Don't remove '/' from id when it's not in the path 2015-03-02 11:24:50 +01:00
Luis Zárate 727df8bd3d Fixed preserved filter for django 1.7
The problem occurs when you have a filter and create o delete a child, when is back to change list
the filter is lost, and have a e=-1 as a get parameter
2015-02-09 08:15:42 -06:00
Frankie Dintino 1be1fc02db Fix missing items bug in qset on child of PolymorphicModel w custom pk
fixes #66
2015-01-31 17:11:03 -05:00
Frankie Dintino ad63c6a442 Test missing items bug in qset on child of PolymorphicModel w custom pk
refs #66
2015-01-31 17:10:57 -05:00
Frankie Dintino fd24863db5 Cleanup tests by removing spurious errors and unnecessary noise
- Remove diamond inheritance tests since these test a bug in Django,
  not in django_polymorphic.
- Fix spurious print message in test_primary_key_custom_field_problem(),
  where uuid instances are for some reason being compared to uuid.UUID
  classes. Replaced with a test that checks that the primary key values
  are valid UUIDs.
- Remove Django > 1.6 conditionals wrapping the multiple inheritance
  tests and model definitions, in favor of using the definitions for
  Django 1.7. Django 1.7 requires a custom primary key when using concrete
  model inheritance because failing to do so is potentially ambiguous. Adding
  the custom primary key does not break tests in older Django versions.
2015-01-31 16:59:55 -05:00
Frankie Dintino a3d9379876 Set _default_manager directly on model_cls; don't use add_to_class()
Using model_cls.add_to_class() calls Manager.contribute_to_class(),
which then sets the attribute to an instance of ManagerDescriptor. In
the case of _default_manager, this behavior differs from Django's, as
_default_manager is set to the manager instance itself, not its
descriptor. This is why it is normally possible to access default_manager
from a model instance.

fixes #96
2015-01-31 13:17:56 -05:00