Add serialization for Enum and CombinedExpression.

Review Request #12043 — Created Feb. 4, 2022 and submitted

Information

Django Evolution
release-2.x

Reviewers

This enhances the serialization support to represent Enum values and
CombinedExpression instances.

Enums are stored as a dictionary with metadata needed to resolve the
enum.

CombinedExpression is used only in generated Python code. It's turned
into a <left> <op> <right> expression in code. Support is partially
implemented for versions prior to Django 2.0, but not tested. This
feature is really only used in a way that matters for evolutions in 2.0
or higher, which is important, because prior versions don't support
object deconstruction, meaning they can't be serialized without explicit
serializers written for them.

Tested with upcoming changes that use these types.

Summary ID
Add serialization for Enum and CombinedExpression.
This enhances the serialization support to represent `Enum` values and `CombinedExpression` instances. `Enum`s are stored as a dictionary with metadata needed to resolve the enum. `CombinedExpression` is used only in generated Python code. It's turned into a `<left> <op> <right>` expression in code. Support is partially implemented for versions prior to Django 2.0, but not tested. This feature is really only used in a way that matters for evolutions in 2.0 or higher, which is important, because prior versions don't support object deconstruction, meaning they can't be serialized without explicit serializers written for them.
c9cf310bf851ef420ba56270111cdc20ad84c005
Description From Last Updated

F401 'django_evolution.serialization.Enum' imported but unused

reviewbotreviewbot

F811 redefinition of unused 'test_with_deferrable' from line 303

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

chipx86
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-2.x (500928d)