Skip to content

Commit

Permalink
refactor: change model_mixin name to models_mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
mariajgrimaldi committed Nov 5, 2024
1 parent d963f58 commit 0efb913
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,24 @@

from django.db import models

from openedx_learning.apps.authoring.containers.models import ContainerEntity, ContainerEntityVersion
from openedx_learning.apps.authoring.containers.models import (
ContainerEntity,
ContainerEntityVersion,
)

from django.db.models.query import QuerySet

from openedx_learning.apps.authoring.publishing.model_mixins import PublishableEntityMixin, PublishableEntityVersionMixin
from openedx_learning.apps.authoring.publishing.model_mixins import (
PublishableEntityMixin,
PublishableEntityVersionMixin,
)

__all__ = [
"ContainerEntityMixin",
"ContainerEntityVersionMixin",
]


class ContainerEntityMixin(PublishableEntityMixin):
"""
Convenience mixin to link your models against ContainerEntity.
Expand Down Expand Up @@ -50,6 +57,7 @@ def created(self):
class Meta:
abstract = True


class ContainerEntityVersionMixin(PublishableEntityVersionMixin):
"""
Convenience mixin to link your models against ContainerEntityVersion.
Expand All @@ -69,7 +77,9 @@ def get_queryset(self) -> QuerySet:
)
)

objects: models.Manager[ContainerEntityVersionMixin] = ContainerEntityVersionMixinManager()
objects: models.Manager[ContainerEntityVersionMixin] = (
ContainerEntityVersionMixinManager()
)

container_entity_version = models.OneToOneField(
ContainerEntityVersion,
Expand Down

0 comments on commit 0efb913

Please sign in to comment.