My database has the tables books[isbn,name,author,availableNum],students[name,major,coursestaking],course[name,department,number,capacity,booksNeeded],department[name,courses] I have a small view that has fields from all the above {courseName,booksRecommended,dept,countofstudents}. When creating a model for view should I say something like this.
class Lookup(models.Model):
course = models.ForeignKey('course',db_column = 'name')
booksRecommended = models.ForeignKey('books',db_column = 'isbn')
dept = models.ForeignKey('department',db_column = 'name')
studentcount = models.IntegerField()
I'm getting the error ProgrammingError: column lookup.id does not exist. Ideas are welcome