So after thinking about it a
> while I came up with a  database

do you have the database set up?

if so you could set up cake to bake your inital models controllers and views

student table would have id name etc

course table would have id title etc

final_grades table would have course_id student_id grade etc

http://book.cakephp.org/view/113/Code-Generation-with-Bake

hth - S

2008/9/11 soldier.coder <[EMAIL PROTECTED]>

>
> I am totally new to Cake and need some help understanding models.  But
> first let me give some background.  I have a friend who is an English
> teacher and she asked me if I could set something up so she can enter
> grades in different weighted categories, and allow students to see
> their own grades (and no one elses).  So after thinking about it a
> while I came up with a  database. And now I am questioning the right
> way to go about setting up the models and controllers.
>
> My first question is can anyone show me the proper way to set up the
> models for a table that belongs to more than one table?  For instance
> I have a final_grades table that includes a course id, a student id
> and the final grade.  So how one would say that the final_grades table
> belongs to both the courses table and the students table.
>
> Also when naming fields in tables that will be used as foreign keys
> for other tables I'm a bit shaky on how the convention is used.  Would
> I, for example, name the field `course_id` that holds the course id in
> both the `final_grades` table and the `courses` table`?
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to