Hi all!

I am looking for right way to add fields to model that is in another
app. At first I created mysite application and in models.py put

from satchmo.contact.models import Contact
Contact.add_to_class("company_name", models.CharField(max_length =
200))

that raises exception ProgrammingError sometimes:
ProgrammingError: (1110, "Column 'company_name' specified twice")

So now I check before if field is already in model:

if 'company_name' not in Contact._meta.get_all_field_names():
    Contact.add_to_class("company_name", models.CharField(max_length =
200))

I have feeling that this is not right way to do. I'd appreciate any
help, hint or thought on this.
I also wonder how models are loaded in django.

Bojan




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to