On Mon, Feb 16, 2009 at 3:29 PM, reidster <reidmckin...@gmail.com> 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 user to generate this id column value or > be able to modify it. In some examples I've seen when using > scaffolding the "id" column is not presented to the view for the user > to interact with.
Do you mean that your forms have a text input with/for the PK? They should be hidden inputs, and then only for your edit forms. I can think of only one reason why Cake would create regular inputs for your PK and that's if Cake doesn't know that it's the PK. But, if the column is named 'id' and is set as the PK in the DB there shouldn't be any problem. If you're referring to the html tables that Bake creates, just remove them from the view. It's been a while since I used Bake, so I don't remember offhand if it does include those automatically. > Is there any way to make the primary key columns of my tables non- > visible and yet still part of the DML (delete, update, insert, select) > statements that are sent to the database when the user performs a > submit? I am using postgresql 8.3. My understanding is that MySQL > uses autoincrement and PG uses sequences (like Oracle). Does CakePHP > account for primary key columns that are populated with sequences > instead of autoincrement? The postgres driver, DboPostgres, handles that. It works just fine with sequences. --~--~---------~--~----~------------~-------~--~----~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---