# |
Aug 8th 2008, 14:50 |
lqdice____ |
teknoid: only problem is im doing a 'Contain' and GroupsNode doesn't seem to have a reference to 'Node' .. when I do Group->find(..'contain'=>array('Node'=>'condition(...))) its fine but when i do that to GroupsNode it doesnt |
# |
Aug 8th 2008, 14:48 |
digor |
i have this in a comment model, http://bin.cakephp.org/view/617195461, and i can still put newlines in the body field |
# |
Aug 8th 2008, 14:44 |
lqdice____ |
i had done this before too just had forgotten |
# |
Aug 8th 2008, 14:43 |
teknoid |
ehh... ok :) |
# |
Aug 8th 2008, 14:43 |
lqdice____ |
i lub you |
# |
Aug 8th 2008, 14:43 |
lqdice____ |
ohh |
# |
Aug 8th 2008, 14:43 |
teknoid |
lqdice____: $this->Group->GroupsNode->find('all', array('conditions'=>array('GroupsNode.group_id'=>5, 'GroupsNode.write_access'=>1... |
# |
Aug 8th 2008, 14:42 |
lqdice____ |
teknoid: can you give a quick example ? |
# |
Aug 8th 2008, 14:42 |
teknoid |
lqdice____: pass conditions to your join table model... |
# |
Aug 8th 2008, 14:41 |
polumrak |
ACTION is scared :( |
# |
Aug 8th 2008, 14:40 |
lqdice____ |
t.t |
# |
Aug 8th 2008, 14:38 |
jaredhoyt |
not from me, my habtm experience is still kinda limited ;) |
# |
Aug 8th 2008, 14:38 |
lqdice____ |
any clues? |
# |
Aug 8th 2008, 14:38 |
lqdice____ |
hmm ad7six gave me some advice on how to do a condition on a HABTM join table but it doesnt work .. group habtm nodes.. my groups_nodes table has a 'write_access' col .. i want all nodes that have write_access for some group |
# |
Aug 8th 2008, 14:37 |
jaredhoyt |
there might be something in the paginator though that will let you change the limits in the pagination links, but i'm not sure ;) |
# |
Aug 8th 2008, 14:36 |
infantigniter |
jaredhoyt: makes sense. shoulld have thought of that. thanks :) |
# |
Aug 8th 2008, 14:36 |
jaredhoyt |
i don't think it's setup to just change the limits on different pages automatically |
# |
Aug 8th 2008, 14:36 |
jaredhoyt |
infantigniter: then i'd imagine you'd have you to do a check on the 'page' param and set the $paginate variable on the fly accordingly |
# |
Aug 8th 2008, 14:35 |
CrazyTux[m] |
teknoid, so in otherwords, I was unable to group order the condensed results |
# |
Aug 8th 2008, 14:35 |
CrazyTux[m] |
teknoid, I wasnt able to get the ORDER BY RAND(), and LIMIT 5, THEN ORDER alphabetical effect |
# |
Aug 8th 2008, 14:34 |
infantigniter |
jaredhoyt: but i already have my paginate var set to limit 5. the limit should CHANGE to 20 upon clicking the "next" button. feel me? |
# |
Aug 8th 2008, 14:34 |
teknoid |
CrazyTux[m]: find('all', array('order'=>'rand()', 'limit'=>5)); you can probably figure out the rest |
# |
Aug 8th 2008, 14:34 |
jaredhoyt |
infantigniter: var $paginate in your controller |
# |
Aug 8th 2008, 14:33 |
infantigniter |
ie, where to put an option such as "limit" and "offset", if that's possible. the API is hard to read about this |
# |
Aug 8th 2008, 14:33 |
CrazyTux[m] |
teknoid, the SQL bit using find |
# |
Aug 8th 2008, 14:33 |
infantigniter |
i have my $paginate far set up so that it limits 5 for the first find, which is what I want. but i want it to start showing 20 per page once the user clicks the "next" button. i know i will probably have to create my own "next" link, but does anybody know how to go aobut this specifically |
# |
Aug 8th 2008, 14:33 |
teknoid |
CrazyTux[m]: which part? |
# |
Aug 8th 2008, 14:30 |
CrazyTux[m] |
Alright guys, I'm giving in, and getting rid of MainController |
# |
Aug 8th 2008, 14:29 |
CrazyTux[m] |
teknoid, care to shed some light |
# |
Aug 8th 2008, 14:29 |
teknoid |
CrazyTux[m]: that's accomplished pretty easily with find() |
# |
Aug 8th 2008, 14:29 |
TommyO |
if you HAVE to (and you don't) you'd make a custom model method and do it in there |
# |
Aug 8th 2008, 14:28 |
TommyO |
CrazyTux[m]: for 1 thing it NEVER belongs in a controller |
# |
Aug 8th 2008, 14:28 |
CrazyTux[m] |
TommyO, Cake, could not easily acomplish this simple SQL task AFAIK. |
# |
Aug 8th 2008, 14:28 |
CrazyTux[m] |
TommyO, whats ugly about the SQL? |
# |
Aug 8th 2008, 14:28 |
teknoid |
CrazyTux[m]: well, that's not a correct approach (most likely) in this case |
# |
Aug 8th 2008, 14:27 |
TommyO |
it's gonna be 20 minutes of fixes before we even get to the ugly sql code on line 20. ughh |
# |
Aug 8th 2008, 14:27 |
teknoid |
CrazyTux[m]: what exactly does your main/home page accompish? |
# |
Aug 8th 2008, 14:27 |
CrazyTux[m] |
teknoid, well thats why I decided on a seperate controller? |
# |
Aug 8th 2008, 14:27 |
teknoid |
CrazyTux[m]: that's for you to decide... |
# |
Aug 8th 2008, 14:27 |
CrazyTux[m] |
or anything else that relates. |
# |
Aug 8th 2008, 14:27 |
CrazyTux[m] |
TommyO, so why throw it in Conditions Controller, over Therapies |