# Path: tests/patterns_app/models.py
# class IdentifiedModel(patterns.IdentifiedModel):
#     pass
# 
# class CustomPatternModel(models.Model):
#     name = models.CharField(max_length=10)
# 
# class CustomTypedPatternModel(models.Model):
#     name = models.CharField(max_length=10)
# 
# class CustomType(models.Model):
#     name = models.CharField(max_length=10)
# 
#     def __str__(self):
#         return self.name
# 
# class Campaign(models.Model):
#     pass
# 
# class Attribute(models.Model):
#     name = models.CharField(max_length=10)
#     campaign = models.ForeignKey(Campaign, models.CASCADE)
#     is_active = models.BooleanField()
#     category = models.CharField(max_length=10, blank=True)
# 
# class Entity(models.Model):
#     campaign = models.ForeignKey(Campaign, models.CASCADE)
# 
#     class Meta:
#         verbose_name_plural = 'entities'
# 
# Path: tests/patterns_app/serializers.py
# class CustomPatternSerializer(patterns.AttachedModelSerializer):
#     attachments = CustomAttachmentSerializer(many=True)
# 
# class CustomTypedPatternSerializer(patterns.AttachedModelSerializer):
#     attachments = CustomTypedAttachmentSerializer(many=True)


from wq.db import rest
from wq.db.patterns import rest as patterns
from wq.db.patterns.identify.views import IdentifiedModelViewSet
from .models import (
    IdentifiedModel,
    CustomPatternModel, CustomTypedPatternModel, CustomType,
    Campaign, Attribute, Entity
)
from .serializers import (
    CustomPatternSerializer, CustomTypedPatternSerializer,
)
rest.router.register_model(
    IdentifiedModel,
    serializer=patterns.IdentifiedModelSerializer,
    fields='__all__',
    viewset=IdentifiedModelViewSet,
)
rest.router.register_model(
    CustomPatternModel,
    serializer=CustomPatternSerializer,
    fields='__all__',
)
rest.router.register_model(
    CustomTypedPatternModel,
    serializer=CustomTypedPatternSerializer,
    fields='__all__',
)
rest.router.register_model(
    CustomType,
    fields='__all__',
)
rest.router.register_model(
    Campaign,
    fields='__all__')
rest.router.register_model(
    Attribute,
    fields='__all__')

# Path: tests/patterns_app/models.py
# class IdentifiedModel(patterns.IdentifiedModel):
#     pass
# 
# class CustomPatternModel(models.Model):
#     name = models.CharField(max_length=10)
# 
# class CustomTypedPatternModel(models.Model):
#     name = models.CharField(max_length=10)
# 
# class CustomType(models.Model):
#     name = models.CharField(max_length=10)
# 
#     def __str__(self):
#         return self.name
# 
# class Campaign(models.Model):
#     pass
# 
# class Attribute(models.Model):
#     name = models.CharField(max_length=10)
#     campaign = models.ForeignKey(Campaign, models.CASCADE)
#     is_active = models.BooleanField()
#     category = models.CharField(max_length=10, blank=True)
# 
# class Entity(models.Model):
#     campaign = models.ForeignKey(Campaign, models.CASCADE)
# 
#     class Meta:
#         verbose_name_plural = 'entities'
# 
# Path: tests/patterns_app/serializers.py
# class CustomPatternSerializer(patterns.AttachedModelSerializer):
#     attachments = CustomAttachmentSerializer(many=True)
# 
# class CustomTypedPatternSerializer(patterns.AttachedModelSerializer):
#     attachments = CustomTypedAttachmentSerializer(many=True)


# Path: tests/patterns_app/rest.py
from wq.db import rest
from wq.db.patterns import rest as patterns
from wq.db.patterns.identify.views import IdentifiedModelViewSet
from .models import (
    IdentifiedModel,
    CustomPatternModel, CustomTypedPatternModel, CustomType,
    Campaign, Attribute, Entity
)
from .serializers import (
    CustomPatternSerializer, CustomTypedPatternSerializer,
)

rest.router.register_model(
    IdentifiedModel,
    serializer=patterns.IdentifiedModelSerializer,
    fields='__all__',
    viewset=IdentifiedModelViewSet,
)
rest.router.register_model(
    CustomPatternModel,
    serializer=CustomPatternSerializer,
    fields='__all__',
)
rest.router.register_model(
    CustomTypedPatternModel,
    serializer=CustomTypedPatternSerializer,
    fields='__all__',
)
rest.router.register_model(
    CustomType,
    fields='__all__',
)
rest.router.register_model(
    Campaign,
    fields='__all__')
rest.router.register_model(
    Attribute,
    fields='__all__')

rest.router.register_model(