mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Refs #28909 -- Simplifed code using unpacking generalizations.
This commit is contained in:
parent
4fc8fb7dda
commit
8ef8bc0f64
33 changed files with 84 additions and 97 deletions
|
@ -99,7 +99,7 @@ attribute. The ``name`` attribute of the base class will be ignored.
|
|||
In order to fully serialize your ``Restaurant`` instances, you will need to
|
||||
serialize the ``Place`` models as well::
|
||||
|
||||
all_objects = list(Restaurant.objects.all()) + list(Place.objects.all())
|
||||
all_objects = [*Restaurant.objects.all(), *Place.objects.all()]
|
||||
data = serializers.serialize('xml', all_objects)
|
||||
|
||||
Deserializing data
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue