start to refactor fields and eclude_fields into ExcludableItems to simplify access

This commit is contained in:
collerek
2021-02-26 17:47:52 +01:00
parent 7bf781098f
commit ad9d065c6d
9 changed files with 434 additions and 20 deletions

View File

@ -204,8 +204,8 @@ async def test_selecting_subset():
all_cars_dummy = (
await Car.objects.select_related("manufacturer")
.fields(["id", "name", "year", "gearbox_type", "gears", "aircon_type"])
.fields({"manufacturer": ...})
.exclude_fields({"manufacturer": ...})
# .fields({"manufacturer": ...})
# .exclude_fields({"manufacturer": ...})
.fields({"manufacturer": {"name"}})
.exclude_fields({"manufacturer__founded"})
.all()