On Mon, 27 May 2013 00:56:08 -0700 (PDT), Marco Bonelli
<marco.bonelli@vallauri.edu> declaimed the following in
gmane.comp.python.django.user:
> Hi, In my models I want to have an optional field to a foreign key. I
> tried this: classe = models.ForeignKey('Classe', null=True)
>
> But i am getting this error:
>
> Table has no column named classe_id
>
> i am using sqlite edit
Well, what is the schema of the database? What is the primary key
field of the table?
If you are creating the schema by hand, rather than within Django's
models, you need to implement all the required background stuff -- a
properly named primary key, for example.
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment