def get_pk_descriptors(cls):
    """Return tuple of tuples with attribute name and descriptor on the
    `cls` that is defined as the primary keys."""
    pk_fields = {
        name: descriptor
        for name, descriptor in vars_class(cls).items()
        if isinstance(descriptor, ObjectField) and is_pk_descriptor(descriptor)
    }
    alt_pk_fields = defaultdict(list)
    for name, descriptor in vars_class(cls).items():
        if isinstance(descriptor, ObjectField):
            if descriptor.alt_pk is True:
                alt_pk_fields[0].append((name, descriptor))
            elif type(descriptor.alt_pk) is int:
                alt_pk_fields[descriptor.alt_pk].append((name, descriptor))
    if len(pk_fields) == 1:
        return ((pk_fields.popitem(),), (alt_pk_fields[0],))
    elif len(pk_fields) > 1:
        unique_pk_fields = {
            name: descriptor
            for name, descriptor in pk_fields.items()
            if descriptor.pk is True
        }
        if unique_pk_fields:
            raise AttributeError(
                "more than one field is marked as unique primary key: %s" % (
                    ', '.join(sorted(pk_fields))))
        pk_descriptors = tuple(sorted((
            (name, descriptor)
            for name, descriptor in pk_fields.items()
        ), key=lambda item: item[1].pk))
        alt_pk_descriptors = tuple(
            alt_pk_fields[idx]
            for idx, (name, descriptor) in enumerate(pk_descriptors)
        )
        return pk_descriptors, alt_pk_descriptors
    else:
        return tuple(), tuple()
Return tuple of tuples with attribute name and descriptor on the
    `cls` that is defined as the primary keys.