Re: fk_name 'user' is not a ForeignKey to <class 'satchmo_store.contact.models.Contact'>

105 views
Skip to first unread message

Nolan Bradshaw

unread,
Jun 23, 2012, 1:38:42 AM6/23/12
to satchmo-d...@googlegroups.com

I believe more context is needed. It doesnt explain what ur attempting to do.

On Jun 22, 2012 9:02 PM, "Cody Goodman" <codygman....@gmail.com> wrote:
If I do this:

admin.site.unregister(Contact)
admin.site.register(Contact)

Is there some kind of special registering that has to be done here? Can we not customize the contact object? Here is the stack trace that causes the error:

/-snip-/python2.6/site-packages/django/contrib/admin/validation.py invalidate_inline
  1.     fk = _get_foreign_key(parent_model, cls.model, fk_name=cls.fk_name, can_fail=True)
    ...
Variable Value
parent_model
<class 'satchmo_store.contact.models.Contact'>
cls
<class 'satchmo_mod.admin.UserTaxExemptInline'>
parent
<class 'django.contrib.admin.options.ModelAdmin'>
f
<django.db.models.fields.related.OneToOneField object at 0x418e250>

/-snip-/python2.6/site-packages/django/forms/models.py in_get_foreign_key
  1.                 raise Exception("fk_name '%s' is not a ForeignKey to %s" % (fk_name, parent_model))
    ...
Variable Value
fks_to_parent
[<django.db.models.fields.related.OneToOneField object at 0x418e250>]
ForeignKey
<class 'django.db.models.fields.related.ForeignKey'>
parent_model
<class 'satchmo_store.contact.models.Contact'>
f
<django.db.models.fields.BooleanField object at 0x418e350>
can_fail
True
fk_name
'user'
fk
<django.db.models.fields.related.OneToOneField object at 0x418e250>
model
<class 'satchmo_mod.models.UserTaxExempt'>
opts
<Options for UserTaxExempt>

Thanks for any help/insight.

--
You received this message because you are subscribed to the Google Groups "Satchmo developers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/satchmo-developers/-/1_qLpIEftHkJ.
To post to this group, send email to satchmo-d...@googlegroups.com.
To unsubscribe from this group, send email to satchmo-develop...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/satchmo-developers?hl=en.
Reply all
Reply to author
Forward
0 new messages