Hi J.Blotus, City belongsTo State, cause a state as many cities. Thats right. First i had State/City hasOne City/State to realize a state capital, but i have been told that hasOne doesn't work here and i have to use belongsTo instead... I always was with doubts about it, but i read this suggestion not only in this group...
I am very interested in your region app. It does make sense of course, but you are able to realize capitals with it? A city has to be able to be a capital of a state or a country. How do you manage it? How look your tables? Thanks On 23 Aug., 20:15, "j.blotus" <[email protected]> wrote: > How does State belongTo City? Isn't it the other way around? Same with > Country. > > On my region based apps I use the following > > Zone hasMany Country, State, Region, City > Country hasMany State, Region, City > State hasMany Region, City > Region hasMany City > > Country belongsTo Zone > State belongsTo Zone, Country > Region belongsTo Zone, Country, State > City belongsTo Zone, Country, State, Region > > Zone is North America, South America, Asia, Etc > > On Aug 18, 5:17 pm, DerBjörn <[email protected]> wrote: > > > Thanks, Dan! > > > After I rebaked my models with following relations: > > > City belongsTo State > > > State belongsTo Country > > State belongsTo City > > State hasMany City > > > Country belongsTo City > > Country hasMany State > > > and updated my views, finally i got a "result"... > > Your advice with "containable" i haven't follow till now. > > > I still have one problem that maybe i am able to solve with cricket's > > advice of using virtual models!?! > > When i want to add p.e. a new country or a new state, their comboboxes > > for capital city are empty, so i cannot choose its capital city. How > > do I solve this problem? > > Thanks a lot :) Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
