class Foo(Model): class Meta: app_label = "tests.test_app" hash_id = HashidsField( salt="Anotherone", hashids_instance=this_hashids_instance )
class TestModel(Model): hashid = HashidsField(real_field_name="id")
class TestAbstractModel(models.Model): hashid = HashidsField(real_field_name="id") class Meta: abstract = True
class TestUser(AbstractUser): hashid = HashidsField(real_field_name="id")
class TestModelWithOwnInstance(Model): hashid = HashidsField(hashids_instance=this_hashids_instance)
class TestModelWithDifferentConfig(Model): hashid = HashidsField(salt="AAA", min_length=5, alphabet="OPQRST1234567890")
class Wishlist(models.Model): hashid = HashidsField(real_field_name="id") user = models.ForeignKey(User, on_delete=models.CASCADE) name = models.CharField(max_length=200)