Changes between Initial Version and Version 1 of Ticket #23533, comment 7
- Timestamp:
- Nov 27, 2025, 4:55:42 AM (3 weeks ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #23533, comment 7
initial v1 1 1 I've created a surprisingly small PoC that works for me. Simon, Can you take a look? 2 3 I've tried it with the following model: 4 {{{#!python 5 from django.db import models 6 7 # Create your models here. 8 9 class MyModelQuerySet(models.QuerySet): 10 pass 11 12 13 class MyModel(models.Model): 14 name = models.TextField() 15 active = models.BooleanField(default=False) 16 code = models.CharField(max_length=255, default="X") 17 18 19 active_objects = MyModelQuerySet.filter(active=True).as_manager() 20 nonactive_objects = MyModelQuerySet.filter(active=False, code="X").as_manager() 21 }}}