<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_pk(self):
 """ Override the default _get_pk method to retrieve the real pk value if we have a SingleValueField or a RedisModel instead of a real PK value """

        pk = super(ExtendedCollectionManager, self)._get_pk()

        if pk is not None and isinstance(pk, RawFilter):
            # We have a RedisModel and we want its pk, or a RedisField
            # (single value) and we want its value
            if isinstance(pk.value, RedisModel):
                pk = pk.value.pk.get()
            elif isinstance(pk.value, SingleValueField):
                pk = pk.value.proxy_get()
            else:
                raise ValueError(u'Invalide filter value for a PK: %s' % pk.value)

        return pk