src/reversion/models.py
def has_int_pk(model):
    """Tests whether the given model has an integer primary key."""
    pk = model._meta.pk
    return (
        (
            isinstance(pk, (models.IntegerField, models.AutoField)) and
            not isinstance(pk, models.BigIntegerField)
        ) or (
            isinstance(pk, models.ForeignKey) and has_int_pk(pk.rel.to)
        )
    )
Tests whether the given model has an integer primary key.
Tests whether the given model has an integer primary key.
Tests whether the given model has an integer primary key .
def has_int_pk(model):
    pk = model._meta.pk
    return (
        (
            isinstance(pk, (models.IntegerField, models.AutoField)) and
            not isinstance(pk, models.BigIntegerField)
        ) or (
            isinstance(pk, models.ForeignKey) and has_int_pk(pk.rel.to)
        )
    )
def has_int_pk ( model ) : pk = model . _meta . pk return ( ( isinstance ( pk , ( models . IntegerField , models . AutoField ) ) and not isinstance ( pk , models . BigIntegerField ) ) or ( isinstance ( pk , models . ForeignKey ) and has_int_pk ( pk . rel . to ) ) )
Tests whether the given model has an integer primary key.
Tests whether the given model has an integer primary key .
"""Tests whether the given model has an integer primary key."""
model