File tree Expand file tree Collapse file tree 2 files changed +13
-19
lines changed
Expand file tree Collapse file tree 2 files changed +13
-19
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 99from django .db import models , transaction
1010from django_lifecycle import ( # type: ignore[import-untyped]
1111 AFTER_CREATE ,
12- BEFORE_CREATE ,
1312 LifecycleModelMixin ,
1413 hook ,
1514)
3029from metadata .models import Metadata
3130from projects .models import Project
3231
33- from .managers import LiveSegmentManager , SegmentManager
34-
3532ModelT = typing .TypeVar ("ModelT" , bound = models .Model )
3633
3734logger = logging .getLogger (__name__ )
3835
3936
37+ class SegmentManager (SoftDeleteExportableManager ):
38+ pass
39+
40+
41+ class LiveSegmentManager (SoftDeleteExportableManager ):
42+ def get_queryset (self ): # type: ignore[no-untyped-def]
43+ """
44+ Returns only the canonical segments, which will always be
45+ the highest version.
46+ """
47+ return super ().get_queryset ().filter (id = models .F ("version_of" ))
48+
49+
4050class ConfiguredOrderManager (SoftDeleteExportableManager , models .Manager [ModelT ]):
4151 setting_name : str
4252
You can’t perform that action at this time.
0 commit comments