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
Bert Constantin2010-11-12 06:33:50 +01:00
52f32c1fc3
improved showfields.py for better and more precise output, updated tests
Bert Constantin2010-10-31 12:27:21 +01:00
a4ac6cc91d
fix object retrieval problem occuring with some custom primary key fields + added UUIDField as test case
Bert Constantin2010-10-30 15:54:13 +02:00
8c3df56cb6
non_polymorphic() queryset member function added
Bert Constantin2010-10-23 12:20:23 +02:00
19adbdaf2c
extra(): Re-implemented. Now is polymorphic (nearly) without restrictions. Added test cases + docs.
Bert Constantin2010-10-23 10:58:44 +02:00
6c8d28cbbc
extra(): throw error if unsupported argument is encountered, support 'params' argument, special case Django 1.1
Bert Constantin2010-10-22 13:30:03 +02:00
486a579ac7
Make .extra() only disable polymorphic query if an arg that is currently not handled is actually used. I.e. if all args are supported, then do polymorphic query by default.
Abel Daniel2010-10-12 11:48:02 +02:00
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.
Bert Constantin2010-10-22 12:11:34 +02:00
6628145af7
removed __getattribute__ hack from PolymorphicModel. A somewhat cleaner solution is now used (through __init__) which also completely removes the performance impact of __getattribute__.
Bert Constantin2010-10-18 12:06:50 +02:00
a87481b8b5
polymorphic_dumpdata management command functionality removed; the regular Django dumpdata command now automatically works correctly for polymorphic models and all Django versions (this is handled by PolymorphicModelBase now). Testing for dumpdata has been added.
Bert Constantin2010-10-18 17:39:06 +02:00
f05b854a54
make PolymorphicQuerySet.get_real_instances() an official part of the API
Bert Constantin2010-10-19 18:55:30 +02:00
b1905026bc
Documentation updated. Test_all_versions script added. Some minor misc changes. Added polybench.
Bert Constantin2010-10-20 09:31:36 +02:00
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.
Bert Constantin2010-10-16 14:40:27 +02:00
50b54f5aca
removed requirement for primary key to be an IntegerField.
mathieusteele2010-10-14 19:14:58 -07:00
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
Bert Constantin2010-02-19 17:12:21 +01:00
e6c1e7ec6e
fix "...has no attribute 'sub_and_superclass_dict'". Thanks to Mattias Brändström. this occurred if a subclass defined __init__ and accessed class members before calling the superclass __init__ (__getattribute__ had a problem, as "sub_and_superclass_dict" was set in __init__).
Bert Constantin2010-02-18 17:44:33 +01:00
7e584632b8
fix unnecessary field-name/model-name conflicts (i.e. field_name == model_name.lower() ) => __init__ + __getattribute__ now handle only the Django inheritance references that are needed ('modela_ptr', 'modelc' etc.), avoiding unnecessary conflicts with field names.
Bert Constantin2010-02-18 17:13:05 +01:00
2795f7acd5
some doc + minor code updates (__repr__ + Show... mixins)
Bert Constantin2010-02-04 18:09:15 +01:00