human
Solve the following python programming problem given the following code:
def _init_pk(self) : 
    '
        Adds a wrapper around the documents pk field. The wrapper object gets
        the attributes django expects on the pk field, like name and attname.

        The function also adds a _get_pk_val method to the document.
        ' 
    if ('id_field' in self._meta) : 
        self.pk_name = self._meta ['id_field'] 
        pk_field = getattr (self.document, self.pk_name) 
else : 
        pk_field = None 
self.pk = PkWrapper (pk_field) 
    def _get_pk_val(obj) : 
        return obj.pk 
patch_document (_get_pk_val, self.document, False) 
    if (pk_field is not None) : 
        self.pk.name = self.pk_name 
        self.pk.attname = pk_field.pk_name 
else : 
        self.pk.fake = True 
        self.pk.editable = True 

    
    

    Fix the buggy line: self.pk.attname = pk_field.pk_name
assistant
#Here is Python code to fix the buggy line: self.

self.pk.attname = self.pk_name