Code

Opened 6 years ago

Closed 6 years ago

#6524 closed (fixed)

[patch] bug in serialization documentation example code

Reported by: Matthew Flanagan <mattimustang@…> Owned by: nobody
Component: Documentation Version: master
Severity: Keywords: serialization
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Hi,

Here is a small inline patch for the doc bug:

Index: docs/serialization.txt
===================================================================
--- docs/serialization.txt      (revision 7049)
+++ docs/serialization.txt      (working copy)
@@ -88,7 +88,7 @@

     for deserialized_object in serializers.deserialize("xml", data):
         if object_should_be_saved(deserialized_object):
-            obj.save()
+            deserialized_object.save()

 In other words, the usual use is to examine the deserialized objects to make
 sure that they are "appropriate" for saving before doing so.  Of course, if you trust your data source you could just save the object and move on.

Attachments (0)

Change History (2)

comment:1 Changed 6 years ago by GabrielRoss

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 6 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

(In [7130]) Fixed a few errors in the documentation. Thanks, Matthew Flanagan, panni@… and adamv.

Fixed #6411, #6426, #6524, #6555.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.