# Path: tests/naturalkey_app/models.py
# class NaturalKeyParent(NaturalKeyModel):
#     slug = models.SlugField()
# 
#     def __str__(self):
#         return self.slug
# 
#     class Meta:
#         unique_together = [['slug']]
# 
# class ModelWithNaturalKey(models.Model):
#     key = models.ForeignKey(NaturalKeyChild, models.CASCADE)
#     note = models.TextField()
# 
#     def __str__(self):
#         return "%s: %s" % (self.key, self.note)


from wq.db import rest
from .models import (
    NaturalKeyParent,
    ModelWithNaturalKey
)
from wq.db.patterns.serializers import NaturalKeyModelSerializer


rest.router.register_model(
    NaturalKeyParent,
    fields="__all__",
)
rest.router.register_model(
    ModelWithNaturalKey,
    serializer=NaturalKeyModelSerializer,

# Path: tests/naturalkey_app/models.py
# class NaturalKeyParent(NaturalKeyModel):
#     slug = models.SlugField()
# 
#     def __str__(self):
#         return self.slug
# 
#     class Meta:
#         unique_together = [['slug']]
# 
# class ModelWithNaturalKey(models.Model):
#     key = models.ForeignKey(NaturalKeyChild, models.CASCADE)
#     note = models.TextField()
# 
#     def __str__(self):
#         return "%s: %s" % (self.key, self.note)


# Path: tests/naturalkey_app/rest.py
from wq.db import rest
from .models import (
    NaturalKeyParent,
    ModelWithNaturalKey
)
from wq.db.patterns.serializers import NaturalKeyModelSerializer



rest.router.register_model(
    NaturalKeyParent,
    fields="__all__",
)
rest.router.register_model(
    ModelWithNaturalKey,
    serializer=NaturalKeyModelSerializer,

    fields="__all__",