# Path: hashid_field/field.py
# class HashidField(HashidFieldMixin, HashidCharFieldMixin, models.IntegerField):
#     description = "A Hashids obscured IntegerField"
# 
# class BigHashidField(HashidFieldMixin, HashidCharFieldMixin, models.BigIntegerField):
#     description = "A Hashids obscured BigIntegerField"
# 
#     def __init__(self, min_length=settings.HASHID_FIELD_BIG_MIN_LENGTH, *args, **kwargs):
#         super().__init__(min_length=min_length, *args, **kwargs)
# 
# class HashidAutoField(HashidFieldMixin, models.AutoField):
#     description = "A Hashids obscured AutoField"
# 
# class BigHashidAutoField(HashidFieldMixin, models.AutoField):
#     # This inherits from AutoField instead of BigAutoField so that DEFAULT_AUTO_FIELD doesn't throw an error
#     description = "A Hashids obscured BigAutoField"
# 
#     def get_internal_type(self):
#         return 'BigAutoField'
# 
#     def rel_db_type(self, connection):
#         return models.BigIntegerField().db_type(connection=connection)
# 
#     def __init__(self, min_length=settings.HASHID_FIELD_BIG_MIN_LENGTH, *args, **kwargs):
#         super().__init__(min_length=min_length, *args, **kwargs)


from django.db import models
from hashid_field import HashidField, BigHashidField, HashidAutoField, BigHashidAutoField



class Artist(models.Model):
    id = HashidAutoField(primary_key=True, alphabet="1234567890abcdef")
    name = models.CharField(max_length=40)

    def __str__(self):
        return "{} ({})".format(self.name, self.id)


class Record(models.Model):
    id = BigHashidAutoField(primary_key=True)
    name = models.CharField(max_length=40)
    artist = models.ForeignKey(Artist, on_delete=models.CASCADE, null=True, blank=True, related_name="records")

# Path: hashid_field/field.py
# class HashidField(HashidFieldMixin, HashidCharFieldMixin, models.IntegerField):
#     description = "A Hashids obscured IntegerField"
# 
# class BigHashidField(HashidFieldMixin, HashidCharFieldMixin, models.BigIntegerField):
#     description = "A Hashids obscured BigIntegerField"
# 
#     def __init__(self, min_length=settings.HASHID_FIELD_BIG_MIN_LENGTH, *args, **kwargs):
#         super().__init__(min_length=min_length, *args, **kwargs)
# 
# class HashidAutoField(HashidFieldMixin, models.AutoField):
#     description = "A Hashids obscured AutoField"
# 
# class BigHashidAutoField(HashidFieldMixin, models.AutoField):
#     # This inherits from AutoField instead of BigAutoField so that DEFAULT_AUTO_FIELD doesn't throw an error
#     description = "A Hashids obscured BigAutoField"
# 
#     def get_internal_type(self):
#         return 'BigAutoField'
# 
#     def rel_db_type(self, connection):
#         return models.BigIntegerField().db_type(connection=connection)
# 
#     def __init__(self, min_length=settings.HASHID_FIELD_BIG_MIN_LENGTH, *args, **kwargs):
#         super().__init__(min_length=min_length, *args, **kwargs)


# Path: tests/models.py
from django.db import models
from hashid_field import HashidField, BigHashidField, HashidAutoField, BigHashidAutoField




class Artist(models.Model):
    id = HashidAutoField(primary_key=True, alphabet="1234567890abcdef")
    name = models.CharField(max_length=40)

    def __str__(self):
        return "{} ({})".format(self.name, self.id)


class Record(models.Model):
    id = BigHashidAutoField(primary_key=True)
    name = models.CharField(max_length=40)
    artist = models.ForeignKey(Artist, on_delete=models.CASCADE, null=True, blank=True, related_name="records")

    reference_id = HashidField()