1
0
mirror of https://github.com/django/django.git synced 2025-03-29 10:40:45 +00:00

37 Commits

Author SHA1 Message Date
Mariusz Felisiak
3d508ececb Refs -- Fixed serializers tests if Pillow isn't installed. 2024-12-05 08:51:05 +01:00
Adam Zapletal
d2f2a6a6d5 Refs -- Enabled ImageField test cases in serializer data tests.
This aligns ImageField to be tested in the same way as FileField.
The commented-out test also exists for FileField and relates to .
2024-12-03 15:15:16 +01:00
Adam Zapletal
1636912bf1 Refs -- Fixed serializer test with primary key TextField. 2024-11-28 11:45:34 +01:00
Adam Zapletal
b9aa3239ab Refs -- Fixed YAML serialization of TimeField primary key.
Handling for PyYAML not being able to serialize `datetime.time`
values is moved from `handle_field` to `_value_from_field` as only
non-primary key, non-relation fields are passed into `handle_field`.
2024-11-12 13:23:14 +01:00
Adam Zapletal
3d4fe39bac Refs -- Removed invalid commented out models and tests from serializer tests.
FileField/ImageField cannot be primary keys, so serialization support
for this case will not be implemented.

XMLField was removed in d1290b5b43485c7018ba92981d34c1f96614924e.
2024-03-04 11:38:18 +01:00
Mariusz Felisiak
305757aec1
Applied Black's 2024 stable style.
https://github.com/psf/black/releases/tag/24.1.0
2024-01-26 12:45:07 +01:00
Juan Alvarez
517d3bb4dd Fixed -- Avoided unnecessary selection of non-nullable m2m fields without natural keys during serialization.
By using `select_related(None)` instead of `select_related()`, the
unnecessary joins are completely avoided. Note that the current tests
already covers the change, when the field is not `null=True`.

Regression in f9936deed1ff13b20e18bd9ca2b0750b52706b6c.
2023-08-19 10:29:43 +02:00
Mariusz Felisiak
f9936deed1
Fixed -- Fixed serialization crash on m2m fields without natural keys when base querysets use select_related().
Regression in 19e0587ee596debf77540d6a08ccb6507e60b6a7.

Thanks Martin Svoboda for the report.
2023-06-04 20:49:07 +02:00
django-bot
9c19aff7c7 Refs -- Reformatted code with Black. 2022-02-07 20:37:05 +01:00
Mikolaj Rybinski
8e90560aa8 Fixed -- Fixed detecting primary key values in deserialization when PK is also a FK. 2021-02-05 12:33:43 +01:00
Mariusz Felisiak
d992f4e3c2 Refs -- Removed models.NullBooleanField per deprecation timeline. 2021-01-14 17:50:04 +01:00
Nick Pope
8f10ceaa90 Changed '%s' % value pattern to str(value). 2020-05-04 08:27:18 +02:00
Mariusz Felisiak
cf21fc9bf0
Enforced uniqueness of natural keys used in tests. 2020-04-07 10:54:19 +02:00
Simon Charette
5779cc938a Fixed -- Disabled insert optimization for primary keys with defaults when loading fixtures.
Model.save_base() is called directly when loading fixtures and assumes
existing rows will be updated. Branching of "raw" allows to maintain
the optimization introduced in  while supporting this edge case.

Regression in 85458e94e38c20e57939947ee515a1a53689659f.

Thanks Reupen Shah for the report.
2019-12-30 07:49:10 +01:00
Caio Ariede
555bebe774 Fixed -- Added models.PositiveBigIntegerField. 2019-11-19 09:34:11 +01:00
Nadège Michel
895b15771e Fixed -- Prevented serializing inherited ManyToManyFields in child model. 2019-06-27 15:10:22 +02:00
Matt Wiens
e817ae74da Followed style guide for model attribute ordering. 2018-12-27 19:34:14 -05:00
dmytryi.striletskyi
dcd1025f4c Fixed -- Fixed deserializing natural keys when primary key has a default value.
Co-Authored-By: Hasan Ramezani <hasan.r67@gmail.com>
2018-11-27 18:35:19 -05:00
Peter Inglesby
312eb5cb11 Fixed -- Allowed loaddata to handle forward references in natural_key fixtures. 2018-07-13 17:54:47 -04:00
Tim Graham
5fa4f40f45 Fixed -- Allowed BooleanField to be null=True.
Thanks Lynn Cyrin for contributing to the patch, and Nick Pope for review.
2018-03-20 12:10:10 -04:00
Denys Duchier
cb7860cced Fixed -- Serialized natural keys in multi-table inheritance models.
Thanks João Paulo Melo de Sampaio for the test.
2018-02-12 21:15:04 -05:00
Claude Paroz
256182c43d Revert "Refs -- Enabled serializer tests with time pk model"
This reverts commit 01c6a3e227b645e8dea97e9befecd23d1d3b8581.
Unfortunately, the YAML serializer is not yet able to cope with time values.
2017-09-18 09:34:21 +02:00
Claude Paroz
01c6a3e227 Refs -- Enabled serializer tests with time pk model 2017-09-17 19:29:33 +02:00
Tim Graham
487362fa8f Fixed -- Deprecated the context arg of Field.from_db_value() and Expression.convert_value().
Unused since a0d166306fbdc41f49e6fadf4ec84b17eb147daa.
2017-07-20 16:30:08 -04:00
Claude Paroz
d02fc8dfd3 Refs -- Enabled serializer tests with date/datetime pk model 2017-06-05 21:36:25 +02:00
Tim Graham
0595bca221 Fixed -- Reverted "Fixed -- Serialized natural keys in multi-table inheritance models."
This reverts commit 74a575eb7296fb04e1fc2bd4e3f68dee3c66ee0a as it causes
unexpected migrations and doesn't seem to be the best solution.
2017-02-11 06:34:59 -05:00
chillaranand
d6eaf7c018 Refs -- Replaced super(ClassName, self) with super(). 2017-01-25 12:23:46 -05:00
Simon Charette
cecc079168 Refs -- Stopped inheriting from object to define new style classes. 2017-01-19 08:39:46 +01:00
Claude Paroz
7b2f2e74ad Refs -- Removed six.<various>_types usage
Thanks Tim Graham and Simon Charette for the reviews.
2017-01-18 20:18:46 +01:00
Claude Paroz
f3c43ad1fd Refs -- Removed python_2_unicode_compatible decorator usage 2017-01-18 13:44:34 +01:00
Claude Paroz
d7b9aaa366 Refs -- Removed encoding preambles and future imports 2017-01-18 09:55:19 +01:00
Tim Graham
631f4ab061 Removed Manager.use_for_related_fields and Meta.manager_inheritance_from_future.
Per deprecation timeline. Refs ed0ff913c648b16c4471fc9a9441d1ee48cb5420.
2017-01-17 20:52:04 -05:00
Tim Graham
e6262aaaf8 Refs -- Removed invalid/unneeded FileField.upload_to in tests/docs. 2016-11-30 17:05:31 -05:00
za
321e94fa41 Refs -- Removed "Tests that", "Ensures that", etc. from test docstrings. 2016-11-10 21:30:21 -05:00
João Sampaio
74a575eb72 Fixed -- Serialized natural keys in multi-table inheritance models. 2016-10-12 20:04:57 -04:00
Tim Graham
87338198e9 Fixed -- Deprecated implicit OneToOnField parent_link. 2016-04-22 12:59:41 -04:00
Claude Paroz
50acbf3ff6 Made tests/serializers/models.py a models package
Thanks Tim Graham for the patch series review.
2015-09-26 19:58:43 +02:00