Задать вопрос

Тел: +7 965 3737 888





Dump a model instance and related objects as a Python data structure

<p>This utility makes a text dump of a model instance, including objects related by a forward or reverse foreign key. The result is a hierarchical data structure where</p>
<p>each instance is represented as a list of fields,</p>
<p>each field as a (&lt;name&gt;, &lt;value&gt;) tuple,</p>
<p>each &lt;value&gt; as a primitive type, a related object (as a list of fields), or a list of related objects.</p>
</ul><p>See the docstring for examples.</p>
<p>We used this to make text dumps of parts of the database before and after running a batch job. The format was more useful than stock dumpdata output since all related data is included with each object. These dumps lend themselves particularly well for comparison with a visual diff tool like <a href="http://meldmerge.org/">Meld</a>.</p>

Вопрос полезен? Да0/Нет0

Ответы (1):

Ответ полезен? Да0/Нет0

Interesting. Is there a way to "load" the data back?