Re: Mysql GROUP in containable not working

2010-10-04 Thread Bryan Paddock
eeks... nobody at all? :( On Wed, Sep 29, 2010 at 1:21 PM, Bryan Paddock bryanpadd...@gmail.comwrote: Hey all, Trying to use GROUP by in containable behaviour and it's not working as expected. Ratings model has fields: *Rating.id, Rating.restaurant_id, Rating.rating (1-5)* I have

Mysql GROUP in containable not working

2010-09-29 Thread Bryan Paddock
Hey all, Trying to use GROUP by in containable behaviour and it's not working as expected. Ratings model has fields: *Rating.id, Rating.restaurant_id, Rating.rating (1-5)* I have a query (which amongst other things) fetches the average + total ratings for a restaurant: $restaurant =

Dynamic menu based on deep relationships

2010-08-29 Thread Bryan Paddock
Hey all, I've looked through pretty much every menu tutorial out there for cakephp and have sat for ages to try and think up how I can achieve this but to no avail. I have a semi-complex database structure of establishments (restaurants, hotels etc). Province - Region - Suburb - Establishment

Custom prefix route not working with pagination when named parameters present

2010-07-07 Thread Bryan Paddock
Hey guys, Having a weird problem here. Have a basic function judge_index($type = null) that spits out a simple listing. Basic $this-paginate(); function. In the view I have: $paginator-options(array('url'=array_merge(array('judge' = true), $this-passedArgs))); The judge_index gets called 2

Re: Containable pagination query

2010-04-28 Thread Bryan Paddock
Ah dang. Yeah in the end I made some custom queries to accomplish it. Yoh what a pain. On Tue, Apr 27, 2010 at 10:52 AM, WebbedIT p...@webbedit.co.uk wrote: Your not going to have a massive amount of joy with running calculations of this nature on the fly so I would be looking at

Containable pagination query

2010-04-26 Thread Bryan Paddock
Hey all, I've almost reached the end of application and this last little bit is really getting to me! Can anyone shed some light? Models: Submission hasMany Judging which belongsTo Judge (and submission) The submissions are entries submitted by students. Judgings stores each judges scores they

Correct places to insert authentication code

2010-04-23 Thread Bryan Paddock
Hey guys, I'm having some difficulties with my authentication code. I'm wondering if anyone can point me in the right direction. I have 3 routes set. admin / adminjudge / judge. admin + adminjudge are hardcoded logins as they will never change and use the User model to authenticate. judge uses

Ajax Helper not respecting routes

2010-04-21 Thread Bryan Paddock
Hey all, Weird problem. I have a ajax search form and retrieves submissions and inserts them into a div. The ajax is working although the controller does not respect the prefix. ?php echo $form-create('Submission'); echo $form-input('search', array('class' = 'quicksearch')); echo

Quick habtm problem

2010-04-14 Thread Bryan Paddock
Hey all, Going a bit crazy here I think I need a break from this. Anyways, I have the following tables + relationships Judges MediaSegments (a category that the judge is selected to judge) JudgesMediaSegments (contains judge_id and media_segment_id) How would I find all the judges that belong

Re: Multiple prefix routes. Second route not working.

2010-04-14 Thread Bryan Paddock
Damn, still trying to figure this out. I did make some headway although I still get the error where its looking for the prefixroute_controller instead of the real_controller with the prefixroute_action function. Anybody with any ideas? On Wed, Apr 14, 2010 at 2:02 AM, Bryan Paddock bryanpadd

Re: Quick habtm problem

2010-04-14 Thread Bryan Paddock
...@me.com jeremybu...@mac.com On 14 Apr 2010, at 14:37, Bryan Paddock wrote: Hey all, Going a bit crazy here I think I need a break from this. Anyways, I have the following tables + relationships Judges MediaSegments (a category that the judge is selected to judge) JudgesMediaSegments

Multiple prefix routes. Second route not working.

2010-04-13 Thread Bryan Paddock
Hey all, I have an application that has been running for a while using admin routing. There are normal users as well as admin users. Now the application is growing and I need to create separate judging routes for judges that will log in and moderate the submissions. In my *core.php* I have the

Re: Containable query

2009-12-08 Thread Bryan Paddock
Aahhh.. good idea... I'll try that in the morning and see how it works out... thanks! On Sat, Dec 5, 2009 at 2:35 PM, Tonu Tusk lvot...@googlemail.com wrote: ok - probably not the most efficient, but the following should work if your relationships are setup in the models $submissions =

Re: Containable query

2009-12-02 Thread Bryan Paddock
Hmm... nobody have any ideas? On Tue, Nov 24, 2009 at 4:05 PM, Bryan Paddock bryanpadd...@gmail.comwrote: Hey all, I have this relationship in question: User - hasOne Student - hasMany Submission I'm a bit stumped on how I can fetch all the users who do not have any submissions linked

Containable query

2009-11-24 Thread Bryan Paddock
Hey all, I have this relationship in question: User - hasOne Student - hasMany Submission I'm a bit stumped on how I can fetch all the users who do not have any submissions linked to their name. I've tried: $list = $this-User-find('all', array( 'contain' = array(

Grouping query

2009-10-15 Thread Bryan Paddock
Hey guys, I'm trying to figure out how best to go about doing reports for my current project. It's a website where artists upload their work and then judges make rate + comment etc. My query is in the reporting section. The main model is the Submission model. Submission belongsTo Student,

Re: Grouping query

2009-10-15 Thread Bryan Paddock
. I'm dreading the submissions by week report... Any pointers would be great... I'm trying to leave as much up to the sq On Thu, Oct 15, 2009 at 4:18 PM, Bryan Paddock bryanpadd...@gmail.comwrote: Hey guys, I'm trying to figure out how best to go about doing reports for my current project

Re: Grouping query

2009-10-15 Thread Bryan Paddock
progressively slower should the db fill up... thanks! On Thu, Oct 15, 2009 at 4:54 PM, Bryan Paddock bryanpadd...@gmail.comwrote: Basically I'm just looking for a little finger pointing in the right direction... output of a submission - http://pastebin.com/f221f94c1 I'm trying to do some reporting

Re: Finding deeply related models

2009-09-10 Thread Bryan Paddock
'; Something along those lines. -- *From:* Bryan Paddock [mailto:bryanpadd...@gmail.com] *Sent:* September-09-09 12:42 PM *To:* cake-php@googlegroups.com *Subject:* Re: Finding deeply related models Oh no ways Hmm.. $this-Property-recursive = 1; pr($this-Property

Finding deeply related models

2009-09-09 Thread Bryan Paddock
Hey all, How can I get cake to retrieve deeply related info? *Property *belongsTo *Location *which in turn belongsTo *Country* How can I get $this-Property-find(xx) to return the Country as well? I'm having the same problem with *Property *belongsTo *Seller *which belongsTo *User *(every time I

Re: Finding deeply related models

2009-09-09 Thread Bryan Paddock
recursive only accepts 3 values... -1 / 0 / 1 Tried that :( On Wed, Sep 9, 2009 at 4:57 PM, grigri j...@hendersonwebdesign.com wrote: Set recursive to 2? On Sep 9, 3:21 pm, Bryan Paddock bryanpadd...@gmail.com wrote: Hey all, How can I get cake to retrieve deeply related info

Re: Finding deeply related models

2009-09-09 Thread Bryan Paddock
recursive to 2, 3, and even 6 (in the testReadFakeThread method). hth grigri On Sep 9, 4:01 pm, Bryan Paddock bryanpadd...@gmail.com wrote: recursive only accepts 3 values... -1 / 0 / 1 Tried that :( On Wed, Sep 9, 2009 at 4:57 PM, grigri j...@hendersonwebdesign.com wrote: Set

Re: Regex validation problem.

2009-09-01 Thread Bryan Paddock
Ah in the end I removed the validation completely... realized that putting such restrictions on names is not the best idea (eg unicode chinese/jap names etc) On Mon, Aug 31, 2009 at 5:14 PM, Dr. Loboto drlob...@gmail.com wrote: Your function does all right - alphanumeric values only as you did

Re: Pulling in another table in a find query

2009-08-31 Thread Bryan Paddock
... On Mon, Aug 31, 2009 at 10:28 AM, Bryan Paddock bryanpadd...@gmail.comwrote: Hi there, No, properties do not have an associated area ID. Properties are located via their location_id. Area ID's are used in another portion of the site but in this case it is necessary to do a search on area's

Regex validation problem.

2009-08-31 Thread Bryan Paddock
Hey guys, Having a weird problem here... In my validation everything was working fine except now I needed to change the first + surname validation fields to allow for spaces + dashes. It was originally just working on only alphanumeric characters. The dashes + underscores was an extra addition

Re: redirect after download dialog

2009-08-28 Thread Bryan Paddock
If you really need to do that you may be able to accomplish it by providing the file download inside an iframe and then redirecting the main window... I haven't tried this... it's just an idea... On Fri, Aug 28, 2009 at 3:15 AM, brian bally.z...@gmail.com wrote: You can't. In order to have the

Pulling in another table in a find query

2009-08-28 Thread Bryan Paddock
Hey all, I'm trying to execute a query including a table which is not related. I'm not sure how I can go about doing this... 3 models in question: property (which has a location_id field) location (which has a location_point field stored as geometry point) area (which has an area_box field

HABTM not saving

2009-08-24 Thread Bryan Paddock
Hey all, Ok I'm pulling my hair out here. HABTM save/edit/removes are not happening. I have two models. Channel and Area. The model definitions are configured properly (channel: *var $hasAndBelongsToMany = array( 'Area' )* and area: *var $hasAndBelongsToMany = array( 'Channel' )* ) I have no

HABTM Delete problem

2009-08-18 Thread Bryan Paddock
Hey all, I'm having a strange problem - My HABTM relationship seems to be working out alright except I cannot remove the last remaining entry. This is the situation: areas channels areas_channels I have no problem in adding ares to channels. I can remove areas from channels too... I just cannot

CakePHP and mysql spatial data types

2009-07-22 Thread Bryan Paddock
Hey all, Anyone had any joy with the mysql spatial extensions data types? eg POINT/ LINE/ etc? I can't see any way around this other than custom sql commands... Bryan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Setting up table ID's

2009-07-15 Thread Bryan Paddock
What is the purpose of the UUID? The database generates a unique ID for each user anyways so if it's just for internal usage then just use the ID. If you need a UUID then i'd recommend adding an extra field in the db for it. The correct way to go about it would involve the use of foregin keys.

Re: Simple relationship problem

2009-06-30 Thread Bryan Paddock
at hasAndBelongsToMany http://book.cakephp.org/view/83/hasAndBelongsToMany-HABTM Bryan Paddock wrote: Argh.. I hate gmail shortcut keys. Anyways continuing mail: Heya all, Theres something I'm not doing right here... I have a User model which has one Seller model linked to it which in turn can

Re: Pagination not respecting page numbers

2009-06-30 Thread Bryan Paddock
, Michael On 24 Jun., 20:44, Bryan Paddock bryanpadd...@gmail.com wrote: Hey all, I was using the paginator and it was working pretty well for me when I was using all the search criteria as named url parameters. I discovered that the paginator didn't send the parameters to the next pages so

Simple relationship problem

2009-06-29 Thread Bryan Paddock
Heya all, Theres something I'm not doing right here... I have a User model which has one Seller model linked to it which in turn can have an Agency model linked to it. User Model: hasOne seller. Seller Model: belongsTo user Agency Model: belongsTo seller

Re: Simple relationship problem

2009-06-29 Thread Bryan Paddock
Argh.. I hate gmail shortcut keys. Anyways continuing mail: Heya all, Theres something I'm not doing right here... I have a User model which has one Seller model linked to it which in turn can have an Agency model linked to it. User Model: hasOne seller. Seller Model: belongsTo user

Re: Cakephp 1.2 + swfupload

2009-06-24 Thread Bryan Paddock
?group=cake-phpq=swfuploadqt_g=Search+this+group or at swfupload website: http://swfupload.org/search/node/cakeph I've been using a similar one, Uploadify: www.uploadify.com On Jun 18, 1:38 pm, Bryan Paddock bryanpadd...@gmail.com wrote: Hey guys, I've been sitting with this swfupload module

Pagination not respecting page numbers

2009-06-24 Thread Bryan Paddock
Hey all, I was using the paginator and it was working pretty well for me when I was using all the search criteria as named url parameters. I discovered that the paginator didn't send the parameters to the next pages so implemented sessions to store the criteria. The arrays I create from the

Cakephp 1.2 + swfupload

2009-06-18 Thread Bryan Paddock
Hey guys, I've been sitting with this swfupload module for days and just cant seem to get it right. In my js to create the uploader i have this setting: upload_url: /properties/uploadvideo, and I have my function uploadvideo() in my properties controller I've done some simple debugging like

Accessing auth information from within model class

2009-06-08 Thread Bryan Paddock
Hey all, I can't seem to find out how to access the Auth class from within the model? I have models/property.php where in the afterfind() function I need to perform certain functions based on the user_id if the user is logged in. $this-Auth-user() is not within the scope. I can't use

hooking onto the find() query

2009-06-01 Thread Bryan Paddock
hey guys, is it possible to hook onto the database queries? ie: each time i call a $this-Property-find() or findById() etc etc I would like to perform certain functions on the data returned and include them in the results.. I know I can create my own function for pulling data out but I was

Re: hooking onto the find() query

2009-06-01 Thread Bryan Paddock
*shoots himself for not seeing that... thanks man... On Mon, Jun 1, 2009 at 6:33 PM, Eber Freitas Dias eber.frei...@gmail.comwrote: I guess this is what you need: http://book.cakephp.org/view/76/Callback-Methods On Mon, Jun 1, 2009 at 1:30 PM, Bryan Paddock bryanpadd...@gmail.comwrote

Re: Need help on password generation

2009-05-27 Thread Bryan Paddock
Hi Gangzheng, Use the core ajax helper for that. in your controller: var $helpers = array('Ajax', 'Javascript') var $components = array('RequestHandler') in the view that is going to hold the link, create the link with the ajax helper instead of the html helper: echo $ajax-link( 'Generate

geo-location database

2009-05-27 Thread Bryan Paddock
hey guys, not really a cake specific question but related nonetheless... have any of you worked with international location databases? know of any pay-for or free? busy working on a property site and the requirement is to have it be internationalized with country-state/suburb/county/etc

Re: How to redirect to login page

2009-05-26 Thread Bryan Paddock
Hi Bharani, Read through the cakephp cookbook http://book.cakephp.org More specifically the section on auth: http://book.cakephp.org/view/172/Authentication Pointers: http://book.cakephp.org/view/172/Authentication - set up the Auth component in your app_controller and add setup settings in the

Re: Problem with retrieving data with relationships

2009-05-25 Thread Bryan Paddock
ahhh awesome thanks man... still getting to grips with cakephp here! On Sat, May 23, 2009 at 8:45 PM, Ricky Paz ricky...@gmail.com wrote: Hi, You have to use belongsTo and hasMany for 1-n relationship, and not hasOne and hasMany. In your PropertiesModel, put $belongsTo = 'Seller, and,

Problem with retrieving data with relationships

2009-05-22 Thread Bryan Paddock
Hi all, Just started learning cakephp last week so a bit scratchy and still learning... There are two tables in question here: property - stores rows of properties seller - stores sellers of the properties. - one property can only have one seller - one seller can have many properties