PageRenderTime 63ms CodeModel.GetById 10ms app.highlight 46ms RepoModel.GetById 1ms app.codeStats 0ms

/CHANGES.html

https://bitbucket.org/bconstantin/django_polymorphic/
HTML | 524 lines | 466 code | 58 blank | 0 comment | 0 complexity | 438f5582b1a7c68b671edede078593e9 MD5 | raw file
  1<?xml version="1.0" encoding="utf-8" ?>
  2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  4<head>
  5<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6<meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" />
  7<title></title>
  8<style type="text/css">
  9
 10h1, h2, h3, h4,
 11#table-of-contents
 12{
 13    color: #47c;
 14}
 15h1 { padding-top: 15px; }
 16h2 { padding-top: 10px; }
 17h3 { padding-top: 7px; }
 18
 19a:hover { border-bottom: 1px solid #0066cc; }
 20a {color: #0066cc; text-decoration: none;}
 21
 22li {
 23    padding-top: 5px;
 24    padding-bottom: 5px;
 25}
 26
 27tt {
 28  color: #080;
 29  }
 30
 31blockquote tt {
 32      color: #000
 33}
 34
 35.first {
 36  margin-top: 0 }
 37
 38.last {
 39  margin-bottom: 0 }
 40
 41/*
 42a.toc-backref {
 43  text-decoration: none ;
 44  color: black }
 45*/
 46
 47dd {
 48  margin-bottom: 0.5em }
 49
 50div.abstract {
 51  margin: 2em 5em }
 52
 53div.abstract p.topic-title {
 54  font-weight: bold ;
 55  text-align: center }
 56
 57div.attention, div.caution, div.danger, div.error, div.hint,
 58div.important, div.note, div.tip, div.warning {
 59  margin: 2em ;
 60  border: medium outset ;
 61  padding: 1em }
 62
 63div.attention p.admonition-title, div.caution p.admonition-title,
 64div.danger p.admonition-title, div.error p.admonition-title,
 65div.warning p.admonition-title {
 66  color: red ;
 67  font-weight: bold ;
 68  font-family: sans-serif }
 69
 70div.hint p.admonition-title, div.important p.admonition-title,
 71div.note p.admonition-title, div.tip p.admonition-title {
 72  font-weight: bold ;
 73  font-family: sans-serif }
 74
 75div.dedication {
 76  margin: 2em 5em ;
 77  text-align: center ;
 78  font-style: italic }
 79
 80div.dedication p.topic-title {
 81  font-weight: bold ;
 82  font-style: normal }
 83
 84div.figure {
 85  margin-left: 2em }
 86
 87div.footer, div.header {
 88  font-size: smaller }
 89
 90div.system-messages {
 91  margin: 5em }
 92
 93div.system-messages h1 {
 94  color: red }
 95
 96div.system-message {
 97  border: medium outset ;
 98  padding: 1em }
 99
100div.system-message p.system-message-title {
101  color: red ;
102  font-weight: bold }
103
104div.topic {
105  margin: 2em }
106
107h1.title {
108  text-align: center }
109
110h2.subtitle {
111  text-align: center }
112
113hr {
114  width: 75% }
115
116ol.simple, ul.simple {
117  margin-bottom: 1em }
118
119ol.arabic {
120  list-style: decimal }
121
122ol.loweralpha {
123  list-style: lower-alpha }
124
125ol.upperalpha {
126  list-style: upper-alpha }
127
128ol.lowerroman {
129  list-style: lower-roman }
130
131ol.upperroman {
132  list-style: upper-roman }
133
134p.caption {
135  font-style: italic }
136
137p.credits {
138  font-style: italic ;
139  font-size: smaller }
140
141p.label {
142  white-space: nowrap }
143
144p.topic-title {
145  font-weight: bold }
146
147pre.address {
148  margin-bottom: 0 ;
149  margin-top: 0 ;
150  font-family: serif ;
151  font-size: 100% }
152
153pre.line-block {
154  font-family: serif ;
155  font-size: 100% }
156
157pre.literal-block, pre.doctest-block {
158  margin-left: 2em ;
159  margin-right: 2em ;
160  background-color: #eeeeee }
161
162span.classifier {
163  font-family: sans-serif ;
164  font-style: oblique }
165
166span.classifier-delimiter {
167  font-family: sans-serif ;
168  font-weight: bold }
169
170span.interpreted {
171  font-family: sans-serif }
172
173span.option-argument {
174  font-style: italic }
175
176span.pre {
177  white-space: pre }
178
179span.problematic {
180  color: red }
181
182table {
183  margin-top: 0.5em ;
184  margin-bottom: 0.5em }
185
186table.citation {
187  border-left: solid thin gray ;
188  padding-left: 0.5ex }
189
190table.docinfo {
191  margin: 2em 4em }
192
193table.footnote {
194  border-left: solid thin black ;
195  padding-left: 0.5ex }
196
197td, th {
198  padding-left: 0.5em ;
199  padding-right: 0.5em ;
200  vertical-align: top }
201
202th.docinfo-name, th.field-name {
203  font-weight: bold ;
204  text-align: left ;
205  white-space: nowrap }
206
207h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
208  font-size: 100% }
209
210tt, pre.literal-block, pre.doctest-block {
211  font-size: 115%;
212  line-height: 150% }
213
214ul.auto-toc {
215  list-style-type: none }
216
217</style>
218</head>
219<body>
220<div class="document">
221
222
223<div class="section" id="django-polymorphic">
224<h1><em>django_polymorphic</em></h1>
225</div>
226<div class="section" id="changelog">
227<h1>Changelog</h1>
228<div class="section" id="v1-0-release-candidate-1">
229<h2>2011-01-24 V1.0 Release Candidate 1</h2>
230<div class="section" id="bugfixes">
231<h3>Bugfixes</h3>
232<ul class="simple">
233<li>Fixed GitHub issue 15 (query result incomplete with inheritance).
234Thanks to John Debs for reporting and the test case.</li>
235</ul>
236</div>
237</div>
238<hr class="docutils" />
239<div class="section" id="v1-0-beta-2">
240<h2>2010-11-11 V1.0 Beta 2</h2>
241<div class="section" id="this-is-a-v1-0-testing-release">
242<h3>This is a V1.0 Testing Release</h3>
243<p>Beta 2 accumulated somewhat more changes than intended, and also
244has been delayed by DBMS benchmark testing I wanted to do on model
245inheritance. These benchmarks show that there are considerable
246problems with concrete model inheritance and contemporary DBM systems.
247The results will be forthcoming on the google discussion forum.</p>
248<p>Please also see:
249<a class="reference external" href="http://www.jacobian.org/writing/concrete-inheritance/">http://www.jacobian.org/writing/concrete-inheritance/</a></p>
250<p>The API should be stable now with Beta 2, so it's just about potential
251bugfixes from now on regarding V1.0.</p>
252<p>Beta 2 is still intended for testing and development environments and not
253for production. No complaints have been heard regarding Beta 1 however,
254and Beta 1 is used on a few production sites by some enterprising users.</p>
255<p>There will be a release candidate for V1.0 in the very near future.</p>
256</div>
257<div class="section" id="new-features-and-api-changes-in-beta-2-since-beta-1">
258<h3>New Features and API changes in Beta 2 since Beta 1</h3>
259<ul>
260<li><p class="first">API CHANGE: <tt class="docutils literal">.extra()</tt> has been re-implemented. Now it's polymorphic by
261default and works (nearly) without restrictions (please see docs). This is a (very)
262incompatible API change regarding previous versions of django_polymorphic.
263Support for the <tt class="docutils literal">polymorphic</tt> keyword parameter has been removed.
264You can get back the non-polymorphic behaviour by using
265<tt class="docutils literal"><span class="pre">ModelA.objects.non_polymorphic().extra(...)</span></tt>.</p>
266</li>
267<li><p class="first">API CHANGE: <tt class="docutils literal">ShowFieldContent</tt> and <tt class="docutils literal">ShowFieldTypeAndContent</tt> now
268use a slightly different output format. If this causes too much trouble for
269your test cases, you can get the old behaviour back (mostly) by adding
270<tt class="docutils literal">polymorphic_showfield_old_format = True</tt> to your model definitions.
271<tt class="docutils literal"><span class="pre">ShowField...</span></tt> now also produces more informative output for custom
272primary keys.</p>
273</li>
274<li><p class="first"><tt class="docutils literal">.non_polymorphic()</tt> queryset member function added. This is preferable to
275using <tt class="docutils literal"><span class="pre">.base_objects...</span></tt>, as it just makes the resulting queryset non-polymorphic
276and does not change anything else in the behaviour of the manager used (while
277<tt class="docutils literal">.base_objects</tt> is just a different manager).</p>
278</li>
279<li><p class="first"><tt class="docutils literal">.get_real_instances()</tt>: implementation modified to allow the following
280more simple and intuitive use:</p>
281<pre class="literal-block">
282&gt;&gt;&gt; qs = ModelA.objects.all().non_polymorphic()
283&gt;&gt;&gt; qs.get_real_instances()
284</pre>
285<p>which is equivalent to:</p>
286<pre class="literal-block">
287&gt;&gt;&gt; ModelA.objects.all()
288</pre>
289</li>
290<li><p class="first">added member function:
291<tt class="docutils literal">normal_q_object = ModelA.translate_polymorphic_Q_object(enhanced_q_object)</tt></p>
292</li>
293<li><p class="first">misc changes/improvements</p>
294</li>
295</ul>
296</div>
297<div class="section" id="id1">
298<h3>Bugfixes</h3>
299<ul class="simple">
300<li>Custom fields could cause problems when used as the primary key.
301In derived models, Django's automatic &quot;.pk&quot; field does not always work
302correctly for such custom fields: &quot;some_object.pk&quot; and &quot;some_object.id&quot;
303return different results (which they shouldn't, as pk should always be just
304an alias for the primary key field). It's unclear yet if the problem lies in
305Django or the affected custom fields. Regardless, the problem resulting
306from this has been fixed with a small workaround.
307&quot;python manage.py test polymorphic&quot; also tests and reports on this problem now.
308Thanks to Mathieu Steele for reporting and the test case.</li>
309</ul>
310</div>
311</div>
312<hr class="docutils" />
313<div class="section" id="v1-0-beta-1">
314<h2>2010-10-18 V1.0 Beta 1</h2>
315<div class="section" id="this-is-a-v1-0-beta-testing-release">
316<h3>This is a V1.0 Beta/Testing Release</h3>
317<p>This release is mostly a cleanup and maintenance release that also
318improves a number of minor things and fixes one (non-critical) bug.</p>
319<p>Some pending API changes and corrections have been folded into this release
320in order to make the upcoming V1.0 API as stable as possible.</p>
321<p>This release is also about getting feedback from you in case you don't
322approve of any of these changes or would like to get additional
323API fixes into V1.0.</p>
324<p>The release contains a considerable amount of changes in some of the more
325critical parts of the software. It's intended for testing and development
326environments and not for production environments. For these, it's best to
327wait a few weeks for the proper V1.0 release, to allow some time for any
328potential problems to show up (if they exist).</p>
329<p>If you encounter any such problems, please post them in the discussion group
330or open an issue on GitHub or BitBucket (or send me an email).</p>
331<p>There also have been a number of minor API changes.
332Please see the README for more information.</p>
333</div>
334<div class="section" id="new-features">
335<h3>New Features</h3>
336<ul>
337<li><p class="first">official Django 1.3 alpha compatibility</p>
338</li>
339<li><p class="first"><tt class="docutils literal">PolymorphicModel.__getattribute__</tt> hack removed.
340This improves performance considerably as python's __getattribute__
341generally causes a pretty large processing overhead. It's gone now.</p>
342</li>
343<li><p class="first">the <tt class="docutils literal">polymorphic_dumpdata</tt> management command is not needed anymore
344and has been disabled, as the regular Django dumpdata command now automatically
345works correctly with polymorphic models (for all supported versions of Django).</p>
346</li>
347<li><p class="first"><tt class="docutils literal">.get_real_instances()</tt> has been elevated to an official part of the API:</p>
348<pre class="literal-block">
349real_objects = ModelA.objects.get_real_instances(base_objects_list_or_queryset)
350</pre>
351<p>allows you to turn a queryset or list of base objects into a list of the real instances.
352This is useful if e.g. you use <tt class="docutils literal"><span class="pre">ModelA.base_objects.extra(...)</span></tt> and then want to
353transform the result to its polymorphic equivalent.</p>
354</li>
355<li><p class="first"><tt class="docutils literal">translate_polymorphic_Q_object</tt>  (see DOCS)</p>
356</li>
357<li><p class="first">improved testing</p>
358</li>
359<li><p class="first">Changelog added: CHANGES.rst/html</p>
360</li>
361</ul>
362</div>
363<div class="section" id="id2">
364<h3>Bugfixes</h3>
365<ul class="simple">
366<li>Removed requirement for primary key to be an IntegerField.
367Thanks to Mathieu Steele and Malthe Borch.</li>
368</ul>
369</div>
370<div class="section" id="api-changes">
371<h3>API Changes</h3>
372<p><strong>polymorphic_dumpdata</strong></p>
373<p>The management command <tt class="docutils literal">polymorphic_dumpdata</tt> is not needed anymore
374and has been disabled, as the regular Django dumpdata command now automatically
375works correctly with polymorphic models (for all supported versions of Django).</p>
376<p><strong>Output of Queryset or Object Printing</strong></p>
377<p>In order to improve compatibility with vanilla Django, printing quersets
378(__repr__ and __unicode__) does not use django_polymorphic's pretty printing
379by default anymore. To get the old behaviour when printing querysets,
380you need to replace your model definition:</p>
381<pre class="doctest-block">
382&gt;&gt;&gt; class Project(PolymorphicModel):
383</pre>
384<p>by:</p>
385<pre class="doctest-block">
386&gt;&gt;&gt; class Project(PolymorphicModel, ShowFieldType):
387</pre>
388<p>The mixin classes for pretty output have been renamed:</p>
389<blockquote>
390<tt class="docutils literal">ShowFieldTypes, ShowFields, ShowFieldsAndTypes</tt></blockquote>
391<p>are now:</p>
392<blockquote>
393<tt class="docutils literal">ShowFieldType, ShowFieldContent and ShowFieldTypeAndContent</tt></blockquote>
394<p>(the old ones still exist for compatibility)</p>
395<p><strong>Running the Test suite with Django 1.3</strong></p>
396<p>Django 1.3 requires <tt class="docutils literal">python manage.py test polymorphic</tt> instead of
397just <tt class="docutils literal">python manage.py test</tt>.</p>
398</div>
399</div>
400<hr class="docutils" />
401<div class="section" id="id3">
402<h2>2010-2-22</h2>
403<p>IMPORTANT: API Changed (import path changed), and Installation Note</p>
404<p>The django_polymorphic source code has been restructured
405and as a result needs to be installed like a normal Django App
406- either via copying the &quot;polymorphic&quot; directory into your
407Django project or by running setup.py. Adding 'polymorphic'
408to INSTALLED_APPS in settings.py is still optional, however.</p>
409<p>The file <cite>polymorphic.py</cite> cannot be used as a standalone
410extension module anymore, as is has been split into a number
411of smaller files.</p>
412<p>Importing works slightly different now: All relevant symbols are
413imported directly from 'polymorphic' instead from
414'polymorphic.models':</p>
415<pre class="literal-block">
416# new way
417from polymorphic import PolymorphicModel, ...
418
419# old way, doesn't work anymore
420from polymorphic.models import PolymorphicModel, ...
421</pre>
422<ul class="simple">
423<li>minor API addition: 'from polymorphic import VERSION, get_version'</li>
424</ul>
425<div class="section" id="id4">
426<h3>New Features</h3>
427<p>Python 2.4 compatibility, contributed by Charles Leifer. Thanks!</p>
428</div>
429<div class="section" id="id5">
430<h3>Bugfixes</h3>
431<p>Fix: The exception &quot;...has no attribute 'sub_and_superclass_dict'&quot;
432could be raised. (This occurred if a subclass defined __init__
433and accessed class members before calling the superclass __init__).
434Thanks to Mattias Brändström.</p>
435<p>Fix: There could be name conflicts if
436field_name == model_name.lower() or similar.
437Now it is possible to give a field the same name as the class
438(like with normal Django models).
439(Found through the example provided by Mattias Brändström)</p>
440</div>
441</div>
442<hr class="docutils" />
443<div class="section" id="id6">
444<h2>2010-2-4</h2>
445<div class="section" id="new-features-and-documentation">
446<h3>New features (and documentation)</h3>
447<p>queryset order_by method added</p>
448<p>queryset aggregate() and extra() methods implemented</p>
449<p>queryset annotate() method implemented</p>
450<p>queryset values(), values_list(), distinct() documented; defer(),
451only() allowed (but not yet supported)</p>
452<p>setup.py added. Thanks to Andrew Ingram.</p>
453<p>More about these additions in the docs:
454<a class="reference external" href="http://bserve.webhop.org/wiki/django_polymorphic/doc">http://bserve.webhop.org/wiki/django_polymorphic/doc</a></p>
455</div>
456<div class="section" id="id7">
457<h3>Bugfixes</h3>
458<ul class="simple">
459<li>fix remaining potential accessor name clashes (but this only works
460with Django 1.2+, for 1.1 no changes). Thanks to Andrew Ingram.</li>
461<li>fix use of 'id' model field, replaced with 'pk'.</li>
462<li>fix select_related bug for objects from derived classes (till now
463sel.-r. was just ignored)</li>
464</ul>
465</div>
466<div class="section" id="restrictions-caveats-updated">
467<h3>&quot;Restrictions &amp; Caveats&quot; updated</h3>
468<ul class="simple">
469<li>Django 1.1 only - the names of polymorphic models must be unique
470in the whole project, even if they are in two different apps.
471This results from a restriction in the Django 1.1 &quot;related_name&quot;
472option (fixed in Django 1.2).</li>
473<li>Django 1.1 only - when ContentType is used in models, Django's
474seralisation or fixtures cannot be used. This issue seems to be
475resolved for Django 1.2 (changeset 11863: Fixed #7052, Added
476support for natural keys in serialization).</li>
477</ul>
478</div>
479</div>
480<hr class="docutils" />
481<div class="section" id="id8">
482<h2>2010-1-30</h2>
483<p>Fixed ContentType related field accessor clash (an error emitted
484by model validation) by adding related_name to the ContentType
485ForeignKey. This happened if your polymorphc model used a ContentType
486ForeignKey. Thanks to Andrew Ingram.</p>
487</div>
488<hr class="docutils" />
489<div class="section" id="id9">
490<h2>2010-1-29</h2>
491<p>Restructured django_polymorphic into a regular Django add-on
492application. This is needed for the management commands, and
493also seems to be a generally good idea for future enhancements
494as well (and it makes sure the tests are always included).</p>
495<p>The <tt class="docutils literal">poly</tt> app - until now being used for test purposes only
496- has been renamed to <tt class="docutils literal">polymorphic</tt>. See DOCS.rst
497(&quot;installation/testing&quot;) for more info.</p>
498</div>
499<hr class="docutils" />
500<div class="section" id="id10">
501<h2>2010-1-28</h2>
502<p>Added the polymorphic_dumpdata management command (github issue 4),
503for creating fixtures, this should be used instead of
504the normal Django dumpdata command.
505Thanks to Charles Leifer.</p>
506<p>Important: Using ContentType together with dumpdata generally
507needs Django 1.2 (important as any polymorphic model uses
508ContentType).</p>
509</div>
510<hr class="docutils" />
511<div class="section" id="id11">
512<h2>2010-1-26</h2>
513<p>IMPORTANT - database schema change (more info in change log).
514I hope I got this change in early enough before anyone started
515to use polymorphic.py in earnest. Sorry for any inconvenience.
516This should be the final DB schema now.</p>
517<p>Django's ContentType is now used instead of app-label and model-name
518This is a cleaner and more efficient solution
519Thanks to Ilya Semenov for the suggestion.</p>
520</div>
521</div>
522</div>
523</body>
524</html>