Monday, June 1, 2009

A model that belongsTo one (and only one) of several other models

Hello, all.

I have a model for image uploads. Each upload belongs to one other
model, such as Car or House. Currently, I solve this by using one
hasAndBelongsToMany for each model that has images, which works, but
is obviously not ideal.

I see at least two possible, but not pretty, solutions to this:
* Have car_id, house_id etc. in the images table, which leaves you
with a lot of null values.
* Have one model for each model that can have an image like this:
car_image, house_image, which makes for a lot of unnecessary models.

I think the best idea would be to have a field called foreign_key or
somesuch in image, and another field called model, which determines
which model the foreign key connects to, but is this even possible?

Thanks in advance for all your help.

--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

[dynamic_freelancer_group] www.Code-Microsoft.com

Recent Activity
Visit Your Group
Yahoo! Groups

Auto Enthusiast Zone

Discover Car Groups

Auto Enthusiast Zone

Y! Groups blog

The place to go

to stay informed

on Groups news!

Weight Loss Group

on Yahoo! Groups

Get support and

make friends online.

.

__,_._,___

urlencode and named parameters

i wrote a simple search in cakephp php, the syntax of the url is:
http://localhost/model/search/Model.field:value/Model2.field2:value2

and it's good, but i noticed that if the value contains / (for example
"va/lue")there are problems, like:
http://localhost/model/search/Model.field:va/ue/Model2.field2:value2

so i thought to urlencode() the value, and then if i search "va/ue"
again the url become:
http://localhost/model/search/Model.field:va%2Fue/Model2.field2:value2

but this gives me 404.. how can i do?

--
pietro

--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: I want to upgrade my cakephp to the newest version

Thank you very much.

rimoe


2009/6/1 Martin Westin <martin.westin.gc@gmail.com>

That is usually all it takes for a simple update within a major
version of Cake. (1.2.0 -> 1.2.3)
To be totally sure you can also replace the pre-existing files in the
app-folder. These don't change often but once in a while they do.

Updating from 1.1 to 1.2 is a diffreent matter. This should be viewed
more like a migration than an update since quite a few things will
break in old apps.

/Martin



On Jun 1, 8:45 am, Rimoe <meiyo...@gmail.com> wrote:
> Hi,
> I want to upgrade my cakephp to the newest version, I only change the folder
> of
> cake_1.2.1.8004\cake_1.2.1.8004\cake
>
> Is it the succeed for the upgrade?
>
> every one how to upgrade?
>
> Thank you very much
>
> rimoe



--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: I want to upgrade my cakephp to the newest version

That is usually all it takes for a simple update within a major
version of Cake. (1.2.0 -> 1.2.3)
To be totally sure you can also replace the pre-existing files in the
app-folder. These don't change often but once in a while they do.

Updating from 1.1 to 1.2 is a diffreent matter. This should be viewed
more like a migration than an update since quite a few things will
break in old apps.

/Martin

On Jun 1, 8:45 am, Rimoe <meiyo...@gmail.com> wrote:
> Hi,
> I want to upgrade my cakephp to the newest version, I only change the folder
> of
> cake_1.2.1.8004\cake_1.2.1.8004\cake
>
> Is it the succeed for the upgrade?
>
> every one how to upgrade?
>
> Thank you very much
>
> rimoe
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: find("list") doesn't bring back the user choice that is written in the database

Please show the code that you used to do the find, then we may be able
to assist you :)
John

On May 29, 11:02 pm, "simon...@gmail.com" <simon...@gmail.com> wrote:
> Good Afternoon,
>
> I did create a listbox using find(list). It did write the choise 3 in
> the database.
>
> But when I want to edit this choice, it doesn't appear selected.
>
> I'm new to this function so I don't know if there is a method or
> something I should use in this function.
>
> Regards,
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

[phpindia] www.Code-Microsoft.com

Recent Activity
Visit Your Group
Yahoo! Finance

It's Now Personal

Guides, news,

advice & more.

Need traffic?

Drive customers

With search ads

on Yahoo!

Group Charity

California Pet

Rescue: Furry

Friends Rescue

.

__,_._,___