Added support for needs_explicit_pk_field

Django 1.6b2 removed has_auto_field and replaced it with
needs_explicit_pk_field.  With just has_auto_field, inlines are unusable
in 1.6b2.  The needs_explicit_pk_field was also backported to Django
1.5, but I don't know what version that affects.  The change maintains
backwards compatibility by also checking has_auto_field.

I also added the needs_explicit_pk_field/has_auto_field check to the
stacked template in order to support models where the PK field is
editable.