Re: ORDER BY Rating

2009-02-16 Thread Kyle Decot
It still doesn't seem to be working. After looking at the query it is generating, it doesn't seem to be including any of my hasMany items. Any thoughts? On Feb 17, 2:14 am, Miles J wrote: > Well if your trying to get the score from the Skatepark model: > > $this->Skatepark->find('all', array( >

Re: ORDER BY Rating

2009-02-16 Thread Miles J
Well if your trying to get the score from the Skatepark model: $this->Skatepark->find('all', array( 'order' => 'AVG(Rating.score)', 'limit' => 10, 'contain' => array('Rating') )); You would need the containable behavior OR remove the contain and make the recursive higher. $this->Skatepark->find

Re: ORDER BY Rating

2009-02-16 Thread Kyle Decot
Sorry for the confusion. I have a Skatepark modal and a Rating Model. In my Skatepark model, I have: $hasMany = array("Rating"); In my rating table, I have a column called score. I'm trying to get the 10 highest averages of the skateparks. Hope this cleans up what I'm trying to accomplish. On

Re: ORDER BY Rating

2009-02-16 Thread Miles J
I misread your post. Its saying that the score column does not exist in the Rating (ratings) table. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@google

Re: when use the $validate, my hidden value is lost

2009-02-16 Thread Rimoe
Thanks for your answer. I have make one other mistake. when validate, I have no reset the parameter,so, has no the get parameter, reset the value of id. Thanks. 2009/2/17 brian > > Do you mean that the value is not set in the form, or the value is not > in controller's $this->data or something

Re: when use the $validate, my hidden value is lost

2009-02-16 Thread brian
Do you mean that the value is not set in the form, or the value is not in controller's $this->data or something else? Also, try creating your form field like this: $form->hidden('YourModel.id'); On Mon, Feb 16, 2009 at 10:38 PM, Rimoe wrote: > hi, > everyone, > > when I added a $validate in t

Re: ORDER BY fragment in field()

2009-02-16 Thread brian
Thanks for responding but I figured out the problem (and gmail was down for me so i couldn't reply). My AppModel overrides find() based on this tip from Nate: http://bakery.cakephp.org/articles/view/quick-tip-doing-ad-hoc-joins-in-model-find However, as Bambou pointed out in the comments, it br

Re: ORDER BY Rating

2009-02-16 Thread Kyle Decot
That doesn't work. It doesn't seem to be including my Rating table along with my main model. On Feb 16, 11:42 pm, Miles J wrote: > Try 'order' => 'COUNT(*) DESC' --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake

Re: ORDER BY Rating

2009-02-16 Thread Miles J
Try 'order' => 'COUNT(*) DESC' --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+un

ORDER BY Rating

2009-02-16 Thread Kyle Decot
I am trying to create a top 10 list for my website but I'm having some trouble getting my find query to work. Currently I have something like: $top = $this->Model->find('all',array('order'=>"AVG (Rating.score)","limit"=>10)); When I do this however I'm getting the following error: Unknown colum

Re: ORDER BY fragment in field()

2009-02-16 Thread mscdex
On Feb 16, 8:58 pm, brian wrote: > Anyone using field() with the 3rd parameter? Cake is steadfastly > refusing to recognise mine. The query has no ORDER clause, only LIMIT. > > The cookbook[1] suggests 'created DESC' which, as it happens, is > precisely what I want to use. Is the book correct? I'

Re: create an input with $form->input() and disable it?

2009-02-16 Thread mscdex
On Feb 16, 6:36 pm, FranktheTank wrote: > OK, I'll admit my noobishness - can you add any HTML attribute to the > options array, and cake just adds it to the tag?  For instance, if you > add 'width' => '50' it will set width="50" in the input tag? All of the options FormHelper's input method use

when use the $validate, my hidden value is lost

2009-02-16 Thread Rimoe
hi, everyone, when I added a $validate in the model , the validate is show very good, but the hidden value is lost, I added the hidden code, $form->input('id',array('type' => 'hidden')); what should i do? Thanks --~--~-~--~~~---~--~~ You received this message

Re: Model constructor not being called

2009-02-16 Thread Miles J
You know what, this is happening to me right now. On some pages my TeamsUser model works, but on others it does not and errors. When I debug($this->TeamsUser), I expect to see the TeamsUser object, but instead I see the AppModel object, hence I know its not loading. I have no idea why and its halt

Re: Access $data content in afterSave callback

2009-02-16 Thread RyOnLife
You're right! Thanks for referring me to $this->data = false in Model::save(). Turns out something else was causing the problem and that convinced me to go digging for it. brian-9 wrote: > > > $this->data should work without any other assignments. Have a look at > Model::save(). The $data th

Re: Problem with custom model function on hasAndBelongsToMany relationship

2009-02-16 Thread rob_page
Thanks for the response, but I still get the same error. It's like the TradingAccountsTradingSystem model just can't be seen from anywhere except it's own controller... Does anyone know if these join models need to be handled differently somehow? It appears that they do, but what needs to be do

Re: Can you have multiple hasAndBelongsToMany relationships in one model?

2009-02-16 Thread mklappen
Thanks... I did try that but must have made a typo somewhere because it didn't work when I did. got it all working. Thanks again. On Feb 16, 6:00 pm, "Adam Royle" wrote: > var $hasAndBelongsToMany = array('Developer','Publisher'); > > - Original Message - > From: "mklappen" > To: "Cak

Re: Access $data content in afterSave callback

2009-02-16 Thread brian
$this->data should work without any other assignments. Have a look at Model::save(). The $data that's passed in is assigned to the model near the top. Then, $this->data isn't set to false until after afterSave() is called. On Mon, Feb 16, 2009 at 8:55 PM, RyOnLife wrote: > > > I have the same qu

Re: getting another model inside afterSave() cake 1.1

2009-02-16 Thread RyOnLife
Seems to work: $this->Model->method() RyOnLife wrote: > > I have the same question (using Cake 1.2). Any thoughts? Thanks. > > > Mithu wrote: >> >> >> I want to wirte a afterSave() function in app_controller so that afery >> every save operation for all models of the application, i can i

ORDER BY fragment in field()

2009-02-16 Thread brian
Anyone using field() with the 3rd parameter? Cake is steadfastly refusing to recognise mine. The query has no ORDER clause, only LIMIT. The cookbook[1] suggests 'created DESC' which, as it happens, is precisely what I want to use. Is the book correct? I've tried prepending the model name, as well

Re: getting another model inside afterSave() cake 1.1

2009-02-16 Thread RyOnLife
I have the same question (using Cake 1.2). Any thoughts? Thanks. Mithu wrote: > > > I want to wirte a afterSave() function in app_controller so that afery > every save operation for all models of the application, i can insert > LAST_INSERTED id to another table, Is it possible with cake 1.1?

Re: Access $data content in afterSave callback

2009-02-16 Thread RyOnLife
I have the same question. So I can use $this->data in my model, I have this in my controller: $this->Model->data = $this->data Doesn't feel right. Seems like an unnecessary line of code. Better way to get at $this->data from the Model's afterSave()? ORCC wrote: > > > I have the following q

Re: Problem with custom model function on hasAndBelongsToMany relationship

2009-02-16 Thread brian
I believe you need to call it like this $this->controller->TradingAccount->TradingAccountsTradingSystem->getSystemUsePercent(); Although, I'd probably create a method in TradingAccount that then called out to the other model. $this->controller->TradingAccount->getSUP(); function getSUP() { r

Re: Route not working

2009-02-16 Thread brian
On Mon, Feb 16, 2009 at 7:19 PM, Miles J wrote: > > I was kind of basing it on the cookbook: > http://book.cakephp.org/view/46/Routes-Configuration#Passing-parameters-to-action-543 Thanks, I don't remember noticing that. --~--~-~--~~~---~--~~ You received this me

Re: How to track # of file downloads (DB or File)

2009-02-16 Thread brian
On Mon, Feb 16, 2009 at 7:18 PM, Miles J wrote: > > Well you could save each download with a date... Yeah, this is what I'm saying--that, if a date is required, then simply incrementing a single field in the files table will not work and there needs to be a downloads table. The bonus is that you

Re: Route not working

2009-02-16 Thread Miles J
I was kind of basing it on the cookbook: http://book.cakephp.org/view/46/Routes-Configuration#Passing-parameters-to-action-543 I guess ill have to go back and edit all the views, shouldn't take more then 30 min. --~--~-~--~~~---~--~~ You received this message becau

Re: How to track # of file downloads (DB or File)

2009-02-16 Thread Miles J
Well you could save each download with a date... and have a monthly cron that runs, calculates the total for that month and saves it to another table for monthly statistics, then erase all the previous single date records. But unless your doing by day, week, time etc, that wouldn't work. --~--~---

Re: Can you have multiple hasAndBelongsToMany relationships in one model?

2009-02-16 Thread Adam Royle
var $hasAndBelongsToMany = array('Developer','Publisher'); - Original Message - From: "mklappen" To: "CakePHP" Sent: Tuesday, February 17, 2009 9:24 AM Subject: Can you have multiple hasAndBelongsToMany relationships in one model? > > Hi, > > I'm new to cake and this group, I would

Problem with custom model function on hasAndBelongsToMany relationship

2009-02-16 Thread rob_page
Hello, I hope that someone can help me with this very odd problem. I'm trying to call a custom model function, and I keep getting the following error: SQL Error: 1064: You have an error in your SQL syntax; Query: getSystemUsePercent Now, I'm using custom model functions in many other places i

Can you have multiple hasAndBelongsToMany relationships in one model?

2009-02-16 Thread mklappen
Hi, I'm new to cake and this group, I would like to know if it is possible to add multiple hasAndBelongsToMany relationships in one model? ( I assume it is...) my declaration & first instance of it is working fine, however it's not letting me add another... example: Thanks in advance. mk --~-

Re: create an input with $form->input() and disable it?

2009-02-16 Thread FranktheTank
OK, I'll admit my noobishness - can you add any HTML attribute to the options array, and cake just adds it to the tag? For instance, if you add 'width' => '50' it will set width="50" in the input tag? If so, that rocks, and will keep me from asking questions like this one again. Thanks! Frank

Re: How to track # of file downloads (DB or File)

2009-02-16 Thread Alfredo Quiroga-Villamil
An approach to this could also be setting up a trigger in your database. This way you wouldn't need any code. You would let mysql for example do the work for you. Then you can use a neat little trick in mysql and call a "group by with rollup" and get the grouping plus the count. I hope that helps

Re: No password hashing

2009-02-16 Thread stevel
Not quite sure what you were trying to do. How are you creating a new user? Using the Add function in the User controller? If you are, then the password will automatically be hashed by the ACL/Auth before it is saved to the database. On Feb 16, 1:36 pm, toby1kenobi wrote: > Hi there, > >   I'v

Re: Route not working

2009-02-16 Thread brian
On Mon, Feb 16, 2009 at 5:46 PM, Miles J wrote: > > Yes but I tried adding the :id in the route, but it didnt work. Heres > the current code. > > The reason for both id/slug(title) is that previously it was based on > id, and that would be a lot of links to go through and change. How many views

Re: How to track # of file downloads (DB or File)

2009-02-16 Thread brian
On Mon, Feb 16, 2009 at 5:44 PM, Miles J wrote: > > Well just think of it this way. What are you going to do with the > dates for each recorded download? statistics --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "

Re: Route not working

2009-02-16 Thread Miles J
Yes but I tried adding the :id in the route, but it didnt work. Heres the current code. The reason for both id/slug(title) is that previously it was based on id, and that would be a lot of links to go through and change. Router::connect('/games/view/:title-:id', array('controller' => 'games', 'a

Re: How to track # of file downloads (DB or File)

2009-02-16 Thread Miles J
Well just think of it this way. What are you going to do with the dates for each recorded download? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@google

Re: PK showing in views with scaffolding output and Bake generated files

2009-02-16 Thread reidster
Thanks, Brian. I have double-checked and the PG database does show the "id" as a PK for the table. The behavior I see is as follows: When I do an edit on the record, it does not show the id column for update. When I do a new record, it does show the id column for the insert. Of course, I do not

Re: create an input with $form->input() and disable it?

2009-02-16 Thread FranktheTank
I do realize that the disabled field won't get posted, and I don't want it to - it's the automatically generated "Created" date, and I just wanted to show what that date is, and it's convenient to do so right on the form. So if I were to use the 'readonly' option, the data appears on the form and

Re: create an input with $form->input() and disable it?

2009-02-16 Thread FranktheTank
Thank you - this is exactly what I needed. I love the way cake works, though sometimes it can be so easy that it's frustrating - I end up over-thinking and find out later that the thing I want do is a standard, simple option or feature. Thanks again, this worked perfectly. On Feb 16, 3:14 pm, M

No password hashing

2009-02-16 Thread toby1kenobi
Hi there, I've been following the great Acl/Auth tutorial in the manual (http://book.cakephp.org/view/641/Simple-Acl-controlled-Application). I have a problem at the point of creating users (10.2.4 Acts As a Requester) - passwords are added to the database in plain text. This means the logi

Re: How to track # of file downloads (DB or File)

2009-02-16 Thread brian
On Mon, Feb 16, 2009 at 5:02 PM, Mike Cook wrote: > > There's never guarantees of having huge traffic but I do expect to get > a considerable amount, the number of files available will also grow to > several thousand within a year or so - there's certainly potential of > having tens of thousands

Re: How to track # of file downloads (DB or File)

2009-02-16 Thread Mike Cook
There's never guarantees of having huge traffic but I do expect to get a considerable amount, the number of files available will also grow to several thousand within a year or so - there's certainly potential of having tens of thousands of downloads per month. This actually makes me wonder if I s

Re: Route not working

2009-02-16 Thread brian
Let's back up. You mentioned 2 different URLs in the 1st msg: /games/view/123/Starcraft /games/view/Starcraft The route only has a placeholder for title: '/games/view/:title' That means that the 1st URL will never be matched. Additionally, the params include id, which isn't in the URL that wi

Re: PK showing in views with scaffolding output and Bake generated files

2009-02-16 Thread brian
On Mon, Feb 16, 2009 at 3:29 PM, reidster wrote: > > I am new to CakePHP. I have been experimenting with scaffolding and > bake. It works OK; however, I have one question. I don't understand > why my primary key columns (id) are showing up in the views. As you > may expect, I do not want the

Re: Model constructor not being called

2009-02-16 Thread Miles J
Ive had this problem before and I never had a solution. I had to create a fake model and set the $useTable to the table, and then it would work. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post

Re: Route not working

2009-02-16 Thread Miles J
Eh im still not having any luck with this. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to

Re: l10n and Auth

2009-02-16 Thread Miles J
Can we see your code and in what actions its called? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send

Re: How to track # of file downloads (DB or File)

2009-02-16 Thread brian
On Mon, Feb 16, 2009 at 3:45 PM, Mike Cook wrote: > > I want to track the number of file downloads and I'm wondering if any > here have thoughts on how best to do this. > > At the moment I have a separate Files table for the details that > stores information such as; filename, filesize, version,

Re: How to track # of file downloads (DB or File)

2009-02-16 Thread Miles J
I do the same thing with my downloads. http://www.milesj.me/resources/script/commentia On the "download" action. I find the file in the database, I increment its download count if it exists and then I use the Media view to force a download. Your on the right track. As for the author part, if th

Re: create an input with $form->input() and disable it?

2009-02-16 Thread Me
Note that using "disabled" has the additional consequence that the "disabled" data you show won't POST through on the form, which may be OK depending on your situation. If you don't expect it, you can have phantom data loss If you want non-editable data but need it to POST, use array ( 'reado

isn't a form in the view supposed to find the correct action?

2009-02-16 Thread Marcelo Andrade
Hi there, By the CakePHP conventions, the view's name must be the same as an action in a controller. A common mistake for the newbies is when creating a form in the view is that the echo $form->create('MyModel'); defaults to generate a form for the "add" action. But I think that should be mor

How to track # of file downloads (DB or File)

2009-02-16 Thread Mike Cook
I want to track the number of file downloads and I'm wondering if any here have thoughts on how best to do this. At the moment I have a separate Files table for the details that stores information such as; filename, filesize, version, first_downloaded and downloads. Is incrementing the 'download

PK showing in views with scaffolding output and Bake generated files

2009-02-16 Thread reidster
I am new to CakePHP. I have been experimenting with scaffolding and bake. It works OK; however, I have one question. I don't understand why my primary key columns (id) are showing up in the views. As you may expect, I do not want the user to generate this id column value or be able to modify i

Re: containable on deep model relationships

2009-02-16 Thread brian
Maybe this is related to what you're discussing (includes solution): http://groups.google.com/group/cake-php/browse_thread/thread/9b4f86efc70348e1/67c4776d14362750?show_docid=67c4776d14362750&pli=1 On Mon, Feb 16, 2009 at 2:42 PM, mscdex wrote: > > On Feb 16, 12:29 pm, WebbedIT wrote: >> I hap

Re: recursive 2 with fields problem

2009-02-16 Thread brian
On Mon, Feb 16, 2009 at 1:50 PM, Arak Tai'Roth wrote: > > I can't believe that was it. I thought it automatically grabbed the > status_id like it does for the relationships. > > Thank you for your help. I'm not sure if this is a bug or not. I noticed this a couple of weeks ago and meant to look

Re: create an input with $form->input() and disable it?

2009-02-16 Thread Marcelo Andrade
On Mon, Feb 16, 2009 at 5:01 PM, FranktheTank wrote: > > (..) Is there a simple > way to use $form->input() to display a disable input box? Something like that in your view must work: echo $form->input( 'Model.fieldname', array('disabled'=> 'disabled') ); Best regards. -- MARCELO DE F. ANDRA

Re: deprecation of useful functions

2009-02-16 Thread brian
On Mon, Feb 16, 2009 at 2:07 PM, leo wrote: > >> http://bakery.cakephp.org/articles/view/quick-tip-doing-ad-hoc-joins-... > > Granted this gives great flexibility, but it doesn't really answer my > comment : > I'm not calling into question the new find functionality - that was > just an example.

create an input with $form->input() and disable it?

2009-02-16 Thread FranktheTank
I am looking to display some data in a form and I'd like to include some non editable data in a disabled input box. My client likes the consistent look of the page and I'd like to output this data, along with the rest of the editable data, for reference. Is there a simple way to use $form->input

Re: Model constructor not being called

2009-02-16 Thread mscdex
What does your model class look like? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake

Re: containable on deep model relationships

2009-02-16 Thread mscdex
On Feb 16, 12:29 pm, WebbedIT wrote: > I happily bow to those who know more than me (and I concede that is > most of the active members of the group, including yourself after > answering a unique id issue for me last week) but the book's example > for recursive does not contain a 'deep' belongsTo

Re: deprecation of useful functions

2009-02-16 Thread leo
> http://bakery.cakephp.org/articles/view/quick-tip-doing-ad-hoc-joins-... Granted this gives great flexibility, but it doesn't really answer my comment : I'm not calling into question the new find functionality - that was just an example. Look at the thread title and the first sentence of the co

Re: recursive 2 with fields problem

2009-02-16 Thread Arak Tai'Roth
I can't believe that was it. I thought it automatically grabbed the status_id like it does for the relationships. Thank you for your help. On Feb 16, 10:42 am, brian wrote: > Try adding Build.status_id to that first fields array. > > On Mon, Feb 16, 2009 at 5:22 AM, Arak Tai'Roth > wrote: > >

Re: linux->no, windows->yes

2009-02-16 Thread ingvers
yes, indeed, thank you! On Feb 16, 8:29 pm, Gwoo wrote: > your model filenames are capitilized --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegr

Re: deprecation of useful functions

2009-02-16 Thread brian
On Mon, Feb 16, 2009 at 1:08 PM, haj wrote: > > More detailed explanation and examples in the API doc would be > seriously helpful especially to newer users. > > I wish it had comment section like PHP doc site. I'll second that. Though, unlike the PHP manual, the API is created from the actual s

Re: deprecation of useful functions

2009-02-16 Thread brian
On Mon, Feb 16, 2009 at 1:01 PM, leo wrote: > > Agreed, but what is the sense in deprecating the methods in Cake? The > implication is that a wrapper is to be frowned upon as not 'best > practice' (a phrase that sits with 'politically correct' in my > wastebin of English nonsense). Put simply, t

Re: linux->no, windows->yes

2009-02-16 Thread Gwoo
your model filenames are capitilized --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-

linux->no, windows->yes

2009-02-16 Thread ingvers
Hello, We have been developing project on windows and then moving the same files to linux box and it seems that there is something wrong as all sql selects statements have lost JOINs. Example. Users and Articles Select on Users with recursive 1 or more will give only Users table content and not

Re: question about bindTo

2009-02-16 Thread brian
On Mon, Feb 16, 2009 at 7:14 AM, AD7six wrote: > > What's bindTo? http://api.cakephp.org/search/bindTo Right. > > Try that > http://bakery.cakephp.org/articles/view/quick-tip-doing-ad-hoc-joins-in-model-find In fact, I have seen it and have already used the method for something else. That arti

Re: Multi User Login

2009-02-16 Thread hashmich
Last night I spend a little more research on it and brought up a new keyword, that describes this issue in more common terms: "thread safe" application design. I found some blog entries among thread safe tabbed browsing design... http://coding.derkeiler.com/Archive/PHP/comp.lang.php/2005-04/msg0

Re: deprecation of useful functions

2009-02-16 Thread haj
More detailed explanation and examples in the API doc would be seriously helpful especially to newer users. I wish it had comment section like PHP doc site. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" g

Re: deprecation of useful functions

2009-02-16 Thread leo
Agreed, but what is the sense in deprecating the methods in Cake? The implication is that a wrapper is to be frowned upon as not 'best practice' (a phrase that sits with 'politically correct' in my wastebin of English nonsense). On Feb 16, 6:32 pm, RichardAtHome wrote: > You could always add you

Re: Multiple validation rules per field

2009-02-16 Thread leo
That particular misspelling has bugged me for years. It was actually a keyword in a language I used to use. On Feb 16, 5:42 pm, WebbedIT wrote: > Hi Leo, > > It certainly seems to be down to allowEmpty which the book states ... > > "When set to true, an empty field will skip *all* validation on

Re: deprecation of useful functions

2009-02-16 Thread RichardAtHome
You could always add your own wrappers to your AppModel :-) On Feb 16, 3:52 pm, leo wrote: > > I could never remember the order of the many many > > arguments to find and had to look them up at least once a day. Putting > > them info an associative array helps me a lot because I don't have to >

Re: containable on deep model relationships

2009-02-16 Thread WebbedIT
mscdex: Is that post supposed to explain something to me? If so, then I'm afraid you will have to be a bit more descriptive. I happily bow to those who know more than me (and I concede that is most of the active members of the group, including yourself after answering a unique id issue for me las

Re: Auth/ACL - edit forms and password problems

2009-02-16 Thread dr. Hannibal Lecter
I hope this might be of some help: http://dsi.vozibrale.com/articles/view/manually-hashing-password-and-password-validation On Feb 16, 5:21 pm, Chris wrote: > Perhaps I am just having a blonde moment, but I seem to be having > difficulties with ACL and passwords. > > I followed the example > a

Re: recursive 2 with fields problem

2009-02-16 Thread brian
Try adding Build.status_id to that first fields array. On Mon, Feb 16, 2009 at 5:22 AM, Arak Tai'Roth wrote: > > Also, if you haven't been reading everything. The problem is the fact > that I can obtain the data I need from the Status model, but I cannot > obtain the data from the Phase model. >

Re: Multiple validation rules per field

2009-02-16 Thread WebbedIT
Hi Leo, It certainly seems to be down to allowEmpty which the book states ... "When set to true, an empty field will skip *all* validation on the field" Well spotted on the dependency typo, I have relied on spell checkers too much in life and NetBeans does not catch those for me :o) Paul. --~-

Auth/ACL - edit forms and password problems

2009-02-16 Thread Chris
Perhaps I am just having a blonde moment, but I seem to be having difficulties with ACL and passwords. I followed the example at http://book.cakephp.org/view/641/Simple-Acl-controlled-Application and then once I was confident of what I was doing implemented it into my current project. It has al

Re: ACL throwing self-joined model into infinite recursion

2009-02-16 Thread benjam
I had thought of that (the Parent Child thing on multiple models) but was hoping that Cake was smart enough to know which was which. Thanks for the info, I'll fiddle with it and post the outcome here... On Feb 16, 12:43 pm, AD7six wrote: > On Feb 16, 9:21 am, benjam wrote: > > > Here are some

Re: deprecation of useful functions

2009-02-16 Thread leo
> I could never remember the order of the many many > arguments to find and had to look them up at least once a day. Putting > them info an associative array helps me a lot because I don't have to > remember "pointless" index-numbers. I have the same problem the new way round. The associative arr

Re: Separating user and profile tables

2009-02-16 Thread LunarDraco
I use EAV because I have multiple clients using the same user/profile code. Each client wants a different list of profile fields. I found myself rewritting the same code slightly different each time. It was time to automate some of that process. I have two models Profile and ProfileFields. The Pro

Re: deprecation of useful functions

2009-02-16 Thread Martin Westin
Personally I think that the change to find is one of the bigger improvements to 1.2. I could never remember the order of the many many arguments to find and had to look them up at least once a day. Putting them info an associative array helps me a lot because I don't have to remember "pointless"

Re: Multiple validation rules per field

2009-02-16 Thread leo
I've just looked at some old code and I recall that I had to leave the message string empty for it to work. I didn't have a problem with the position of allowEmpty = true. then in the form, I handles the message like this: echo $form->label('title', __('TITULO_GA_BLOCS',true)); echo $for

Re: Multiple validation rules per field

2009-02-16 Thread WebbedIT
I have a feeling that by assigning allowEmpty = true to my first rule it then skipped all validation when the field was empty ... by moving my second rule to be the first rule I seem to have overcome my problem. What are your thoughts on this? Should allowEmpty on one rule affect all subsequent r

Re: Multiple validation rules per field

2009-02-16 Thread leo
Also, you've misspellt dependency ;) On Feb 16, 4:05 pm, leo wrote: > Just a quick thought without really looking into it: try prepending > the fields with the model name viz: Something.date_operational > > L > > On Feb 16, 4:00 pm, WebbedIT wrote: > > > Hi, > > > Can anyone spot what I am doin

Re: Multiple validation rules per field

2009-02-16 Thread leo
Just a quick thought without really looking into it: try prepending the fields with the model name viz: Something.date_operational L On Feb 16, 4:00 pm, WebbedIT wrote: > Hi, > > Can anyone spot what I am doing wrong?  I have read the book and a few > blog articles on this and think I have ever

Multiple validation rules per field

2009-02-16 Thread WebbedIT
Hi, Can anyone spot what I am doing wrong? I have read the book and a few blog articles on this and think I have everything setup right but can't get validation to apply more than one rule to a field (processes first rule, ignores the rest). Here is my validate declaration for the field in ques

Re: Variables in strings and I18n

2009-02-16 Thread Gonzalo Servat
On Mon, Feb 16, 2009 at 11:36 AM, AD7six wrote: > [..snip..] > > There are very few uses of __() in the core/form helper. The one > you're referring to is: > http://api.cakephp.org/view_source/form-helper/#line-460 > > I would recommend extending the core where it doesn't fit your needs > e.g. >

Re: Model constructor not being called

2009-02-16 Thread JoshSchramm
ok update number 2. I dumped a list of included files and it isnt even including the file that corresponds to this model (which explains why it cant find a constructor). Back to digging. On Feb 16, 9:26 am, JoshSchramm wrote: > A bit more background. I had this same issue a couple days ago and

deprecation of useful functions

2009-02-16 Thread leo
Maybe I'm being old fashioned, but I don't really see the sense in deprecating functions like findAll and findNeighbours in favour of a do-it-all-pseudo-overloaded find. The syntax of the find function I now find extremely confusing e.g. possible parameters 'field' & 'fields'. Made more so because

Re: Hard problem on a save operation

2009-02-16 Thread Bernardo Vieira
You should either check if $this->data is present before running the save operation or if you need to access results from the model before the save method you show use find instead of read. marco.rizze...@gmail.com wrote: > Hi > I have this situation. > I use cake 1.2 stable. > I have a save ope

Hard problem on a save operation

2009-02-16 Thread marco.rizze...@gmail.com
Hi I have this situation. I use cake 1.2 stable. I have a save operation on a model. Now if I make a read operation on a model before the save operation I get that in the $this->data I have also data that come from the read operation. How can I avoid this situation? Many Thanks --~--~-~-

Re: Model constructor not being called

2009-02-16 Thread JoshSchramm
A bit more background. I had this same issue a couple days ago and the only way i was able to solve it was to basically rename the model. At that time it was a model i had just created so it was no big deal to rename, this time though I'm using this all over the place. Even more frustrating this m

Re: Credit Card Expiration Date Validation

2009-02-16 Thread JoshSchramm
Oh cool i didnt know i could code a custom method and call it from the validates array. Thats way better than what I've been doing (override validates.) Thanks. On Feb 11, 9:37 am, grigri wrote: > Here's an excerpt from a model I had for validating this sort of > thing: > > class Order extends

Model constructor not being called

2009-02-16 Thread JoshSchramm
Hey guys. Ive been fighting with a problem for a couple days now and it popped back up this morning. I have a class hotel_group_member that is a model. Some relevant info filename: hotel_group_member.php classname: HotelGroupMember table: hotel_group_members For some reason it isnt getting ini

Re: Auto Update Service

2009-02-16 Thread LunarDraco
No I'm not talking about a way to update core, I'm talking about my product which is built on top of cake. I agree with you completely that this is a bad idea for the cake core. But I think it is something we could all use for the projects we build that are meant to be used by more than one client

Re: containable on deep model relationships

2009-02-16 Thread mscdex
On Feb 16, 4:59 am, WebbedIT wrote: > I asked many questions on here before eventually realising Cake will > not automatically join a deep ( User -> Event -> EventType) belongsTo > association so recursive would not help http://book.cakephp.org/view/439/recursive --~--~-~--~~

Re: l10n and Auth

2009-02-16 Thread Marco
Anyone? On Feb 13, 4:23 pm, Marco wrote: > Hello, > > probably I'm not understanding nothing about how cakephp manage l10n. > Why when I enable the componentAuththe function $this->L10n->get > ('some language') doesn't work? > WithAuthdisactivated all work fine. > > Thanks, > > Marco --~--~-

AW: Containment: strange warning

2009-02-16 Thread Liebermann, Anja Carolin
Found the answer myself: When defining a 'contain' or $containment your must not include the model itself in the array. It still works, because the data is included in your array anyway, but when you use any debug level above 0 you get those irritating warnings. Anja -Ursprüngliche Nachr

  1   2   >