All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Rename internal
userattribute fromVirtualModelto_userto avoid conflict with ForeignKey and OneToOneField fields with the same name
- Include
py.typedfile for type hints - Add support to Python 3.12 and 3.13
- Drop support to Python 3.8 and 3.9
- Add support to Django 5.0, 5.1, and 5.2
- Drop support to Django 3.2, 4.0, and 4.1
- Add support to nested prefetch lookups like
v.VirtualModel(manager=User.objects, lookup="course__facilitators")- Warning: this will remain undocumented for now, because the behavior is strange:
the prefetch is made inside
coursein this case, due to Django behavior.
- Warning: this will remain undocumented for now, because the behavior is strange:
the prefetch is made inside
- Add parameter
serializer_contextto be used inv.Annotationandget_prefetch_queryset.
- Fix support for custom manager in
VirtualModelinitialization - Separate method for
_build_prefetchto allow overrides.
- More robust
is_preloadedcheck - Add Django 4.2 to tests.
- Add Python 3.11 to tests.
- README update.
- Avoid redundant
to_attrwhen nesting Virtual Models - Refactor
fields.pyto useself.parentandself.field_name - Simplify docs and tests by not using manager param
- Handle additional case for related primary key field.
- Change the hints API from
prefetch.Requiredtohints.Virtual.
- Fix documentation link on PyPI.
- First release.