Forums

CC v5 lookup country codes? + "New Model" doesn't work!!

Von Steiner 08 Jul, 2015
I have a list of records from a table that I am successfully displaying with CCv5. I want to replace the country name currently displayed with the country_code from the corejoomla_countries table (different from my table). To do that I have been trying to create another model that associates the country_code with the country name (fieldname 'CoCountry') in my main table.

I can't for the life of me figure out how to do it. I can not seem to find any clear explanation for the fields on the 'New Model' tab and have played around with seemingly all variations of 'belongsTo' and 'hasOne' and the Foreign Key, Fields (to be retrieved) and Primary Key.

I have really looked around extensively for references before asking, but found none. Can you please enlighten me as to how it works? Any references I can read, pick up from previous versions? Do I need to put conditions in? PHP?

On top of this, I accidentally deleted pressed 'Delete model' and now it won't save any new ones when I try to recreate them. If I press 'Apply' or 'Save' and then click on 'Models' there is only the one that was there before. This rather looks like a bug, as I haven't changed anything else.

Help!

Many thanks in advance.

Justin
This topic is locked and no more replies can be posted.