Hi there....

I'm not fully awake yet, but it might be worth trying to think of
things "in reverse" so to speak (and not ideal, but maybe split into
two separate cake calls)

so rather than putting the find method on the data that you ultiamtely
want, put the find query on the model with the clause / condition you
are interested in and let the
pre-specified relationships you should have set between your models
return the User model data as a "by product". (I am still trying to
accept that the cakeway is the cake way and not
necessarily a pure emulation of a simple sql query and as such use
terminology such as "by product" lightly.

so, for example (without explicitly writing code fo you)
find (as list of student_id) all  submissions (omitting duplicates
based on student_id field)
use this resulting list as the NOT condition for a find('all') on the
students model - set your containable to return the User information
in the record set from the
call and it should be workable.

Damn this is a mess.
I'll write test code and repost


On Dec 4, 5:15 pm, abryant <[email protected]> wrote:
> You might also try (from the book.cakephp.org page on Containable)
>
>         $list = $this->User->find('all', array(
>           'contain' => array(
>             'Student' => array(
>               'Submission.student_id' => null
>             )
>           )
>         ));
>
> At least according to the examples in the manual this is an appropriate way
> to filter conditionally on a specific field in a contained relationship
> --
> View this message in 
> context:http://n2.nabble.com/Containable-query-tp4057992p4113719.html
> Sent from the CakePHP mailing list archive at Nabble.com.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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