Hello.

I got the following use case:

----
Customer has Payment methods (many to many)
Customer is a Proxy class of User and Customer has a profile which is
connected with AUTH_PROFILE_MODULE to the User/Customer.

Each order has one customer and one payment method (one payment method
from the methods that are added to the Customer)

To get the payment method inside my Order I got the following inside
the Order model:

payment = models.ForeignKey(Customer, to_field="payment",
related_name="order_customer_payment",verbose_name='Zahlungsart')
-----

Well now I am getting "django.db.models.fields.FieldDoesNotExist:
Customer has no field named 'payment'". I understand why I'm getting
this since the "payment" field is inside the CustomerProfile.

I have also tried to do:

payment = models.ForeignKey(CustomerProfile,to_field="payment",
related_name="order_customer_payment",verbose_name='Zahlungsart')

But this leads to the following error while syncdb:

"Failed to install index for my_app_name.Orders model: table
my_app_name_orders has no column named payment_id"

Is there a possibility to solve the problem?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to