django forms from two tables referencial integrity

Posted by dana on Stack Overflow See other posts from Stack Overflow or by dana
Published on 2010-05-22T11:12:53Z Indexed on 2010/05/22 11:20 UTC
Read the original article Hit count: 227

Filed under:
|
|
|

i have a class named cv,and a class named university, and each user that completes his cv, should choose a University he studyes at.

My problem is: one student can study at one or 2 or three universities, or may be a user that is not student.

I need to take this data into a form, and i use ModelForm. The data from the Cv class, and from the University class in the same form, and the user can add one or more universities, or no university. (in the same form)

How should i do it? Should i use ModelForm? if i have a foreign key in the CV class, and the user is not a student (so he is at zero universities), i may get an referencial integrity error.

thanks a lot

© Stack Overflow or respective owner

Related posts about django

Related posts about integrity