Commit Graph

19 Commits (b73f22f4e0a98f1e0c65625b0293c65b533bfaef)

Author SHA1 Message Date
Diederik van der Boor ff22332d2c Remove Django 1.1 compatibility switch 2013-05-20 23:54:45 +02:00
Tomas Peterka cbf52a61af Porting to Python 3.2
Removed compatibility_tools (because we aim to Python 2.7 and Python 3.2)
Performed 2to3 and modified
Usage of django.utils.six which adds dependency on Django >= 1.4.2
2013-05-20 16:03:21 +02:00
Diederik van der Boor 8cf313335c Handle stale ContentType models (no longer referring to a model)
This builds on top of a fix in Django 1.6, and has a workaround for
Django 1.4 and 1.5. When the base class points to a model that no longer
exists, it will be silently dropped in the polymorphic queryset results.

This behavior is identical to iterating over results when the derived
table doesn't have the object anymore.
2013-05-19 14:35:29 +02:00
Jedediah Smith 58c4f6f697 Optimization - don't do extra queries for proxy models 2013-04-08 00:05:21 +02:00
Jedediah Smith e2cfbf3898 Support proxy models (still requires one query per proxied model, not optimal) 2013-04-07 23:36:09 +02:00
Diederik van der Boor 1f26302632 Fix Django 1.5 support, tests pass again.
The reason polymorphic broke was because it couldn't find some managers
anymore in the inheritance tree. Django 1.5 removes these and replaces
them with an `AbstractManagerDescriptor`. This patch restores those objects
2013-04-07 00:43:41 +02:00
Ben Konrath dc6f41c7e9 Update URLs to github hosted webpage. 2013-03-18 21:27:23 +01:00
Diederik van der Boor f687dc18b1 SQL optimization, avoid query in pre_save_polymorphic()
This query is visible in the django-debug-toolbar POST redirect page
2012-11-15 10:42:02 +01:00
German M. Bravo f987818fe4 PEP 8 cleaning
Conflicts:

	polymorphic/__init__.py
	polymorphic/polymorphic_model.py
2011-12-20 18:59:50 +00:00
German M. Bravo c9922d8987 PEP 8 cleaning 2011-12-20 18:59:50 +00:00
German M. Bravo bb06d6d12b Some more PEP 8 cleaning 2011-12-20 18:59:25 +00:00
Chris Glass c7cbfc0e23 Removed dead imports. 2011-05-19 15:16:39 +02:00
Jonas Obrist ba2cb60c9d Edited polymorphic/polymorphic_model.py via GitHub 2011-05-19 06:04:23 -07:00
Bert Constantin 4a4cfd82a2 translate_polymorphic_Q_object: fixed test case, and made the function a member of PolymorphicObject.
Minor test fixes: warnings fixed, test_tool.py renamed as it's no test
2010-11-12 07:19:23 +01:00
Bert Constantin f78b27dc1a updated docs, tests, misc 2010-11-02 12:21:46 +01:00
Bert Constantin b2357592cb make sure 'base_manager is not inherited (but managed by Django instead).
(This seems more correct but it doen't seem to make any difference.)
Also added related test cases.
2010-10-22 13:35:39 +02:00
Bert Constantin 6628145af7 removed __getattribute__ hack from PolymorphicModel.
A somewhat cleaner solution is now used (through __init__) which
also completely removes the performance impact of __getattribute__.
2010-10-20 09:31:42 +02:00
Bert Constantin 01bdb2f9b0 - renamed ShowField* to ShowFieldType, ShowFieldContent, ShowFieldTypeAndContent, in order to reflect better what they do.
- by default, django_polymorphic's pretty printing of querysets/objects (via ShowField*) is not used anymore
- ShowField mixins now also show the annotations (after the regular fields, prepended by "Ann:")
- cleaned up implementation.
2010-10-19 21:28:33 +02:00
Bert Constantin 116e2af08b IMPORTANT: import path changed, it's now: "from polymorphic import PolymorphicModel, ..."
- added python2.4 compatibility. Contributed by Charles Leifer. Thanks!
- general reorganization of the code - there is no single polymorphic.py module anymore,
  so d-p now needs to be installed as a regular Django app
- polymorphic.VERSION/get_version added
- version numbering started: V0.5 beta
2010-02-22 16:16:00 +01:00