Support for Django Manager/QuerySet
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 516
- PR merge metrics
- No merged PRs in 30d
Description
Are you planning to support Django's Manager/QuerySet interaction?
Example:
```python
from django.db import models
class NotificationQuerySet(models.QuerySet["Notification"]):
def resolved(self):
return self.filter(resolved_at__isnull=False)
class Notification(models.Model):
resolved_at = models.DateTimeField(null=True, blank=True)
objects = NotificationQuerySet.as_manager()
Notification.objects.resolved()
# => Object of class `Manager` has no attribute `resolved`
Notification.objects.all().resolved()
# .all() resolves to QuerySet[Notification, Notification]
# => Object of class `QuerySet` has no attribute `resolved`
```
I would expect both of these to work. Similarly for related managers, e.g. `user.notification_set.resolved()`.
Apologies if there's already an issue about this, I've looked and couldn't find one.
Contributor guide
Assessment
This issue has not been assessed yet.