# Path: sponsors/models/assets.py
# class ImgAsset(GenericAsset):
#     image = models.ImageField(
#         upload_to=generic_asset_path,
#         blank=False,
#         null=True,
#     )
# 
#     def __str__(self):
#         return f"Image asset: {self.internal_name}"
# 
#     class Meta:
#         verbose_name = "Image Asset"
#         verbose_name_plural = "Image Assets"
# 
#     @property
#     def value(self):
#         return self.image
# 
#     @value.setter
#     def value(self, value):
#         self.image = value
# 
# class TextAsset(GenericAsset):
#     text = models.TextField(default="")
# 
#     def __str__(self):
#         return f"Text asset: {self.internal_name}"
# 
#     class Meta:
#         verbose_name = "Text Asset"
#         verbose_name_plural = "Text Assets"
# 
#     @property
#     def value(self):
#         return self.text
# 
#     @value.setter
#     def value(self, value):
#         self.text = value
# 
# class FileAsset(GenericAsset):
#     file = models.FileField(
#         upload_to=generic_asset_path,
#         blank=False,
#         null=True,
#     )
# 
#     def __str__(self):
#         return f"File asset: {self.internal_name}"
# 
#     class Meta:
#         verbose_name = "File Asset"
#         verbose_name_plural = "File Assets"
# 
#     @property
#     def value(self):
#         return self.file
# 
#     @value.setter
#     def value(self, value):
#         self.file = value
# 
# class ResponseAsset(GenericAsset):
#     response = models.CharField(
#         max_length=32, choices=Response.choices(), blank=False, null=True
#     )
# 
#     def __str__(self):
#         return f"Response Asset: {self.internal_name}"
# 
#     class Meta:
#         verbose_name = "Response Asset"
#         verbose_name_plural = "Response Assets"
# 
#     @property
#     def value(self):
#         return self.response
# 
#     @value.setter
#     def value(self, value):
#         self.response = value
# 
# class Response(Enum):
#     YES = "Yes"
#     NO = "No"
# 
#     @classmethod
#     def choices(cls):
#         return tuple((i.name, i.value) for i in cls)
# 
# Path: sponsors/models/managers.py
# class BenefitFeatureQuerySet(PolymorphicQuerySet):
# 
#     def delete(self):
#         if not self.polymorphic_disabled:
#             return self.non_polymorphic().delete()
#         else:
#             return super().delete()
# 
#     def from_sponsorship(self, sponsorship):
#         return self.filter(sponsor_benefit__sponsorship=sponsorship).select_related("sponsor_benefit__sponsorship")
# 
#     def required_assets(self):
#         from sponsors.models.benefits import RequiredAssetMixin
#         required_assets_classes = RequiredAssetMixin.__subclasses__()
#         return self.instance_of(*required_assets_classes).select_related("sponsor_benefit__sponsorship")
# 
#     def provided_assets(self):
#         from sponsors.models.benefits import ProvidedAssetMixin
#         provided_assets_classes = ProvidedAssetMixin.__subclasses__()
#         return self.instance_of(*provided_assets_classes).select_related("sponsor_benefit__sponsorship")


from django import forms
from django.db import models
from django.db.models import UniqueConstraint
from django.urls import reverse
from polymorphic.models import PolymorphicModel
from sponsors.models.assets import ImgAsset, TextAsset, FileAsset, ResponseAsset, Response
from sponsors.models.enums import (
    PublisherChoices,
    LogoPlacementChoices,
    AssetsRelatedTo,
)
from sponsors.models.managers import BenefitFeatureQuerySet

    label = models.CharField(
        max_length=256,
        help_text="What's the title used to display the text input to the sponsor?"
    )
    help_text = models.CharField(
        max_length=256,
        help_text="Any helper comment on how the input should be populated",
        default="",
        blank=True
    )
    max_length = models.IntegerField(
        default=None,
        help_text="Limit to length of the input, empty means unlimited",
        null=True,
        blank=True,
    )

    class Meta(BaseRequiredAsset.Meta):
        abstract = True


class BaseRequiredResponseAsset(BaseRequiredAsset):
    ASSET_CLASS = ResponseAsset

    class Meta(BaseRequiredAsset.Meta):
        abstract = True


class BaseProvidedTextAsset(BaseProvidedAsset):

# Path: sponsors/models/assets.py
# class ImgAsset(GenericAsset):
#     image = models.ImageField(
#         upload_to=generic_asset_path,
#         blank=False,
#         null=True,
#     )
# 
#     def __str__(self):
#         return f"Image asset: {self.internal_name}"
# 
#     class Meta:
#         verbose_name = "Image Asset"
#         verbose_name_plural = "Image Assets"
# 
#     @property
#     def value(self):
#         return self.image
# 
#     @value.setter
#     def value(self, value):
#         self.image = value
# 
# class TextAsset(GenericAsset):
#     text = models.TextField(default="")
# 
#     def __str__(self):
#         return f"Text asset: {self.internal_name}"
# 
#     class Meta:
#         verbose_name = "Text Asset"
#         verbose_name_plural = "Text Assets"
# 
#     @property
#     def value(self):
#         return self.text
# 
#     @value.setter
#     def value(self, value):
#         self.text = value
# 
# class FileAsset(GenericAsset):
#     file = models.FileField(
#         upload_to=generic_asset_path,
#         blank=False,
#         null=True,
#     )
# 
#     def __str__(self):
#         return f"File asset: {self.internal_name}"
# 
#     class Meta:
#         verbose_name = "File Asset"
#         verbose_name_plural = "File Assets"
# 
#     @property
#     def value(self):
#         return self.file
# 
#     @value.setter
#     def value(self, value):
#         self.file = value
# 
# class ResponseAsset(GenericAsset):
#     response = models.CharField(
#         max_length=32, choices=Response.choices(), blank=False, null=True
#     )
# 
#     def __str__(self):
#         return f"Response Asset: {self.internal_name}"
# 
#     class Meta:
#         verbose_name = "Response Asset"
#         verbose_name_plural = "Response Assets"
# 
#     @property
#     def value(self):
#         return self.response
# 
#     @value.setter
#     def value(self, value):
#         self.response = value
# 
# class Response(Enum):
#     YES = "Yes"
#     NO = "No"
# 
#     @classmethod
#     def choices(cls):
#         return tuple((i.name, i.value) for i in cls)
# 
# Path: sponsors/models/managers.py
# class BenefitFeatureQuerySet(PolymorphicQuerySet):
# 
#     def delete(self):
#         if not self.polymorphic_disabled:
#             return self.non_polymorphic().delete()
#         else:
#             return super().delete()
# 
#     def from_sponsorship(self, sponsorship):
#         return self.filter(sponsor_benefit__sponsorship=sponsorship).select_related("sponsor_benefit__sponsorship")
# 
#     def required_assets(self):
#         from sponsors.models.benefits import RequiredAssetMixin
#         required_assets_classes = RequiredAssetMixin.__subclasses__()
#         return self.instance_of(*required_assets_classes).select_related("sponsor_benefit__sponsorship")
# 
#     def provided_assets(self):
#         from sponsors.models.benefits import ProvidedAssetMixin
#         provided_assets_classes = ProvidedAssetMixin.__subclasses__()
#         return self.instance_of(*provided_assets_classes).select_related("sponsor_benefit__sponsorship")


# Path: sponsors/models/benefits.py
from django import forms
from django.db import models
from django.db.models import UniqueConstraint
from django.urls import reverse
from polymorphic.models import PolymorphicModel
from sponsors.models.assets import ImgAsset, TextAsset, FileAsset, ResponseAsset, Response
from sponsors.models.enums import (
    PublisherChoices,
    LogoPlacementChoices,
    AssetsRelatedTo,
)
from sponsors.models.managers import BenefitFeatureQuerySet


    label = models.CharField(
        max_length=256,
        help_text="What's the title used to display the text input to the sponsor?"
    )
    help_text = models.CharField(
        max_length=256,
        help_text="Any helper comment on how the input should be populated",
        default="",
        blank=True
    )
    max_length = models.IntegerField(
        default=None,
        help_text="Limit to length of the input, empty means unlimited",
        null=True,
        blank=True,
    )

    class Meta(BaseRequiredAsset.Meta):
        abstract = True


class BaseRequiredResponseAsset(BaseRequiredAsset):
    ASSET_CLASS = ResponseAsset

    class Meta(BaseRequiredAsset.Meta):
        abstract = True


class BaseProvidedTextAsset(BaseProvidedAsset):

    ASSET_CLASS = TextAsset