Hi,

I am trying to improve my university's course bidding system using
CakePHP (and learning it in the process). As a prototype, I have the
following data model:

* users [id, login, name, points]
* bid_sessions [id, title, cap, starts_at, ends_at]
* bid_session_registrations [bid_session_id, user_id]
* bids [id, user_id, bid_session_id, bid_points, created, modified]

User hasMany Bid; BidSession hasMany Bid; Bid belongsTo User,
BidSession; User <--HABTM--> BidSession (joinTable =>
bid_session_registrations).

I have used the bake script to generate the models, controllers and
scaffold views. Now the troubles:

(a) If I go to /users/add, I get the following SQL error: 1064: You
have an error in your SQL syntax; ... near 'bid_session_registrations`
AS `BidSessionRegistration`   WHERE 1 = 1' at line 1 [CORE\cake\libs
\model\datasources\dbo_source.php, line 512]. Query: SELECT
`BidSessionRegistration`.`user_id`, BidSessionRegistration`. FROM
`bid_session_registrations` AS `BidSessionRegistration` WHERE 1 = 1.
Note the missing field name before 'FROM'. This table has PK
(bid_session_id, user_id). If I remove that and add an id field as PK,
things start working. However, since I am not interested in using this
join model directly, I shouldn't have to do this ... as far as I
understand from the manual and other cake blogs/tutorials.

(b) The generated scaffold view for /bid_sessions/add correctly shows
me a list (multi-select) of users to choose from for that session.
However, in /users/add, the code shows a select drop down for Bid
Session Registrations (and options for listing/creating Bid Session
Registrations). Shouldn't cake be generating a list of Bid Sessions to
choose from (as in the other case)?

I just can't understand the reasons behind these or what I am doing
incorrectly ...

Also, though not directly related to HABTM, but does anyone know of
any simple method to make the Auth component work with POP3
authentication? I can do my own checks, but being able to use the Auth
component would be nice ...

Thanks in advance!

--~--~---------~--~----~------------~-------~--~----~
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