# Path: content_gallery/models.py
# class ContentGalleryMixin(models.Model):
#     """
#     A mixin that adds the ContentGallery features to any model
#     of you project. It allows to access all related images via
#     the 'gallery' field. The 'gallery_visible' flag is used to hide
#     your model from the list in the content_gallery.Image admin page
#     by setting it to False. But you still can add images from the
#     admin pages of you models.
#     """
# 
#     content_gallery = GenericRelation(Image)  # the manager of related images
#     gallery_visible = True  # the flag of visibility in the Image admin
# 
#     class Meta:
#         abstract = True


from django.db import models
from content_gallery.models import ContentGalleryMixin


# the ContentGalleryMixin enables the Content Gallery for the model

class Cat(ContentGalleryMixin, models.Model):

    SEX_CHOICES = {
        ('M', "Male"),
        ('F', "Female")
    }

    name = models.CharField(max_length=50)
    age = models.IntegerField(null=True, blank=True)
    sex = models.CharField(
        max_length=1,
        choices=SEX_CHOICES,
        null=True,
        blank=True

# Path: content_gallery/models.py
# class ContentGalleryMixin(models.Model):
#     """
#     A mixin that adds the ContentGallery features to any model
#     of you project. It allows to access all related images via
#     the 'gallery' field. The 'gallery_visible' flag is used to hide
#     your model from the list in the content_gallery.Image admin page
#     by setting it to False. But you still can add images from the
#     admin pages of you models.
#     """
# 
#     content_gallery = GenericRelation(Image)  # the manager of related images
#     gallery_visible = True  # the flag of visibility in the Image admin
# 
#     class Meta:
#         abstract = True


# Path: content_gallery_testapp/testapp/models.py
from django.db import models
from content_gallery.models import ContentGalleryMixin



# the ContentGalleryMixin enables the Content Gallery for the model

class Cat(ContentGalleryMixin, models.Model):

    SEX_CHOICES = {
        ('M', "Male"),
        ('F', "Female")
    }

    name = models.CharField(max_length=50)
    age = models.IntegerField(null=True, blank=True)
    sex = models.CharField(
        max_length=1,
        choices=SEX_CHOICES,
        null=True,
        blank=True

    )