Commit Graph

784 Commits (10f65638528208af5e9b8207faad3eb406f61d0c)

Author SHA1 Message Date
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
mathieusteele 50b54f5aca removed requirement for primary key to be an IntegerField. 2010-10-14 19:14:58 -07: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
Bert Constantin 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__).
2010-02-18 20:18:49 +01:00
Bert Constantin 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.
2010-02-18 20:05:17 +01:00
Bert Constantin 2795f7acd5 some doc + minor code updates (__repr__ + Show... mixins) 2010-02-18 20:04:38 +01:00
Bert Constantin 2fcb7fba1a queryset order_by method added, testcase, docs 2010-02-04 16:38:58 +01:00
Bert Constantin b4aeae417e queryset values(), values_list(), distinct() documented; defer(), only() allowed (but not yet supported) 2010-02-04 16:14:10 +01:00
Bert Constantin cf42a8111b setup.py added. Thanks to Andrew Ingram. 2010-02-04 15:28:56 +01:00
Bert Constantin c10577c32f queryset aggregate() and extra() methods implemented, testcases, docs 2010-02-04 15:28:55 +01:00
Bert Constantin 9e7a78a8cb queryset annotate() method implemented, and testcase 2010-02-04 15:28:55 +01:00
Bert Constantin a99a3b5bfc fix remaining potential accessor name clashes (but this only works with Django 1.2+, for 1.1 no changes). Thanks to Andrew Ingram. 2010-02-04 15:28:49 +01:00
Bert Constantin ecaed2a71f fixed use of 'id', replaced with 'pk' 2010-02-04 15:13:44 +01:00
Bert Constantin 2e17a184c0 fix select_related bug for objects from derived classes (till now sel.-r. was just ignored) 2010-02-04 15:13:44 +01:00
Bert Constantin 2a740e9b10 doc- and minor code updates 2010-02-04 15:13:33 +01:00
Bert Constantin c7ac78e08d Fixed ContentType related field accessor clash (an error emitted by model validation),
by adding related_name to the ContentType ForeignKey. Thanks to  Andrew Ingram.
This happened if a polymorphc model used a ContentType ForeignKey.
Plus minor documentation updates.
2010-01-30 14:15:52 +01:00
Bert Constantin 2055d03688 minor README.rst fix 2010-01-29 13:55:38 +01:00
Bert Constantin 8bdda93e76 Restructured django_polymorphic into a regular add-on application.
This is needed for the management commands, and also seems
to be a generally good idea for future viablity as well.
Also misc documentation updates.
2010-01-29 13:41:19 +01:00
Bert Constantin dd84e911d0 fix "manage.py dumpdata", by adding polymorphic_dumpdata command (github issue 4) 2010-01-29 00:02:27 +01:00
Bert Constantin d8cdfb02ff minor test case fix: MROBase1 2010-01-28 22:34:14 +01:00
Bert Constantin 53d82def56 (IMPORTANT, 2010-1-26 new db schema.) This patch here fixes issue 1 (github)
In PolymorphicModelBase.__new__ we work around a limitation with the
app_label detection in Django ModelBase (which could raise IndexError).
2010-01-28 20:45:28 +01:00
Bert Constantin e51425f5df updated docs 2010-01-28 20:39:07 +01:00
Bert Constantin c2b420aea0 IMPORTANT: DB schema changed: Django's ContentType is now used
instead of app-label and model-name (suggested by Ilya Semenov in issue 3).
This is a cleaner and more efficient solution, and applabel/modelname
are not stored redundantly in additional tables any more (the polymorphic models).
This should be the final DB schema now (sorry for any inconvenience).
Also some minor documentation updates.
2010-01-26 22:31:56 +01:00
Bert Constantin da599856b6 added editable=False to internal model fields (issue2) 2010-01-26 22:10:17 +01:00
Bert Constantin ba9a0b1302 updated docs, and moved them to DOCS.rst and README.rst 2010-01-26 14:28:22 +01:00
Bert Constantin e3346bd4fb move test db to /var/tmp/ 2010-01-25 16:47:28 +01:00
Bert Constantin 09fef376ac manage.py: prepend ./libraries-local to sys.path, allowing us to test any version of Django (after being copied there) 2010-01-24 16:24:10 +01:00
Bert Constantin f77ebe8149 Model___field notation now automatically chooses correct application + separated translation into own function 2010-01-23 06:42:01 +01:00
Bert Constantin 1ba36e9fb1 fix __getattribute__ rstrip bug 2010-01-17 22:50:23 +01:00
Bert Constantin 889ce78f2e add pre_save_polymorphic(), split from save() 2010-01-17 19:53:25 +01:00
Bert Constantin 2729187591 manager: proxy all unknown methods 2010-01-16 18:03:25 +01:00
Bert Constantin 2e29b8f093 add polymorphic_internal_model_fields 2010-01-16 18:01:58 +01:00
Bert Constantin acb7452c46 minor doc fixes 2010-01-16 00:32:36 +01:00
Bert Constantin 576a16f2ab initial commit 2010-01-15 21:13:36 +01:00