Thanks Rajesh, The actual question is what the difference is between those 2 definitions, between a OntToOne and an instance relationship?
Cheers! On 19 mayo, 16:22, Rajesh Dhawan <[EMAIL PROTECTED]> wrote: > Hi, > > On May 18, 12:49 pm, bcurtu <[EMAIL PROTECTED]> wrote: > > > Hi, > > > What's the difference between: > > > class Other(models.Model): > > ins=Instrument() > > > class Other2(models.Model): > > ins=models.OneToOneField(Instrument) > > > How do I define Instrument in order the fist class to be valid? > > You would have to have Instrument be a valid model field for the first > class above to be valid. It doesn't look like that's what you are > after. > > ins=Instrument() simply instantiates the class Instrument and assigns > it to the class-level field ins of Other. > > Perhaps you should explain what you are trying to achieve? > > -Rajesh --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---