Michael Radziej wrote:

>Vittorino Parenti schrieb:
>  
>
>>Hi,
>>i found this in django documentation:
>>
>>"Note, however, that you can only use strings to refer to models in the 
>>same models.py file -- you cannot use a string to reference a model in a 
>>different application, or to reference a model that has been imported 
>>from elsewhere."
>>
>>i have different models.py, how can i do?
>>    
>>
>
>You use the model class itself like this:
>
>from otherapp.models import OtherModel
>...
>class ThisModel(...)
>    bla = ForeignKey(OtherModel, ...)
>
>I haven't tried this, though, it should work.
>
>Michael
>
>
>>
>  
>
I tried to insert, as you have said to me, but have received this error:

Unhandled exception in thread started by <function inner_run at 0xb7a7610c>
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/django/core/management.py", 
line 1100, in inner_run
    validate()
  File "/usr/lib/python2.4/site-packages/django/core/management.py", 
line 1062, in validate
    num_errors = get_validation_errors(outfile)
  File "/usr/lib/python2.4/site-packages/django/core/management.py", 
line 928, in get_validation_errors
    for r in rel_opts.get_all_related_objects():
  File "/usr/lib/python2.4/site-packages/django/db/models/options.py", 
line 124, in get_all_related_objects
    if f.rel and self == f.rel.to._meta:
AttributeError: 'str' object has no attribute '_meta'

hekp me.
Thanks,
V.

-- 
Vittorino Parenti

Thunder Systems Srl
Tel. 0258018011
Fax 0258018012
www.thundersystems.it

**** Riservatezza ****
In ottemperanza al D.L. n. 196 del 30/6/2003 in materia di protezione dei dati 
personali, le informazioni contenute in questo messaggio sono strettamente 
riservate ed esclusivamente indirizzate al destinatario indicato (oppure alla 
persona responsabile di rimetterlo al destinatario).
Vogliate tener presente che qualsiasi uso, riproduzione o divulgazione di 
questo messaggio e' vietato. Nel caso in cui aveste ricevuto questo messaggio 
per errore, vogliate cortesemente avvertire il mittente e distruggere il 
presente messaggio.

**** Confidentiality ****
According to the Italian law D.L. 196/2003 concerning the security of personal 
data, all the information contained in this message are strictly confidential 
and exclusively intended for the addressee (or for a person authorized to 
delivery it to him/her).
You are hereby notified that any disclosure, reproduction, distribution or 
dissemination or use of this communication is strictly prohibited. If you have 
received this message in error, please destroy it and notify us immediately by 
email.


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

Reply via email to