modify your artist.yml file to:
form_setup:<br />
works:<br />
class: OneToMany<br />
params:<br />
display_field: name<br />
table_fields: name, description
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
February 13, 2008 3:25pm
Subscribe [27]#181 / Mar 21, 2008 1:38pm
modify your artist.yml file to:
form_setup:<br />
works:<br />
class: OneToMany<br />
params:<br />
display_field: name<br />
table_fields: name, description
#182 / Mar 21, 2008 2:24pm
Thanks for the speedy reply jTaby! 😊
works: is under form_setup: when the error happens. Here’s the complete code of artists.yml
db_table:artists
controller_name: CRUD
page_header: Artists
rules:
name: required
description: required
form_setup:
name:
class: TextBox
description:
class: TextArea
works:
class: OneToMany
params:
display_field: name
table_fields: name, description#183 / Mar 21, 2008 6:32pm
Failed to mention. The error is still there.
#184 / Mar 21, 2008 6:50pm
Sorry, I misread your original post.
The Table name missing error comes up when you have a malformed URL. Could you paste the URL when you get the error? Also, could you tell me what your table schema is so that I can see if I can recreate the problem?
#185 / Mar 21, 2008 7:10pm
The error is happening inside the OneToMany box after I click on the Add New link.
This is the URL on the address bar:
http://localhost/ci/backend.php/?c=crud&m=add&t=artists
This is the URL on the Add New Link:
http://localhost/ci/backend.php/?c=crud&m=add&t=artists#
As for the DB, i just have 2 tables, artists and works. Works has artists_id in it. They both have name, description etc; pretty basic stuff at the moment.
Thanks 😊
#186 / Mar 22, 2008 3:53pm
I’m new to codeExtinguisher, but I must say I’m impressed with the ease of use, and the way it enables me to wireframe applications quickly. Great job!
One question though: what would be the best approach if I wanted to have seperate user-accounts, each having their own contacts, products, etc?
Would I be creating a ManyToMany relationship between users and contacts, users and products, etc?
#187 / Mar 22, 2008 7:53pm
In Date when entering the box the jscalendar won’t shows up
I am also having this problem, but what I notice is the datepicker javascript is not loading in the header of my test file (it does load in the Example file). I’m having trouble figuring out which function generates the header and why my test file wouldn’t load a header identical to the Example.
#188 / Mar 22, 2008 10:36pm
Fatal error: Cannot access empty property in ../codex/application/plugins/onetomany.php on line 41
Can someone explain why I’m getting this error whenever I call the OTM plugin?
#189 / Mar 23, 2008 9:53am
I can’t get ManyToMany to work properly. I’m trying to make the two tables reference each other. EI Artists and Exhibits. They should both reference each other. When I setup Artists to reference Exhibits it looks for artists_exhibits, which is fine, but when Exhibits tries to reference Artists it looks for exhibits_artists which can’t work for me. They both have to look for the same table. Cake does it properly by arranging the table names alphabetically so regardless of which table is referencing which, the ManyToMany table will always be artists_exhibits.
#190 / Mar 23, 2008 10:17pm
Hello jTabby,
I found another problem with dbdropdown.
I want to filter my dbdropdown with my session or something else, when I try to modify the plugin i can’t get the result like I want to. How to do the filter in dbdropdown ?
Thxs
#191 / Mar 23, 2008 10:26pm
Hey guys, as you might have realized from another thread, i’m really busy with school (last month of the semester =\), so I haven’t actually had time to work on codex in a while, I apologize. (If you want to help develop codex, send me a PM).
Ok, so i’ll try to address your issues as best I can (I’m taking a break from studying 😊)
@gerben, by defining a OneToMany or ManyToMany relationship. Look at the bundled example for reference.
@timj, I found the problem. The Date plugin loads the javascript file on-demand. That is, the javascript file doesn’t get loaded if it’s not used. Now, because the date picker in your one-to-many relationship isn’t requested in the original page load, then the file isn’t included in the header. However, the ajax return just assumes it is. (did you follow that?) I’ll try to fix it. As far as your error, did you define a display_field in your YAML file?
@mattewr, ah, good point, I didn’t see that use-case…i’ll try to fix it
@Andi, As of now, you can’t do that, and I realize that’s a big limitation. What I have planned is to have the ability to optionally use Models instead of YAML files. That way you can define your own callbacks, and have more advanced functionality (Kinda like the django admin)
#192 / Mar 24, 2008 7:04am
I have two question:
1) it is possible to insert into the view file a custom javascript different for each view? Example: i use a YAV tool for validate form client side. How it is possible to insert into each view file the js?
2)It is possible to insert into a form a free field, i.e. a text not in tha table, or a text get from another table?
Thank you Ciao
#193 / Mar 25, 2008 1:05pm
I am having problems. Latest version of CI (latest SVN) then the form generation works fine for a simple table until I create a .yml file (even an empty one) I get the message:
An Error Was Encountered
You must define a table name in your controller.The MySQL Table:
CREATE TABLE `gallery` (
`id` bigint(11) NOT NULL auto_increment,
`picture` varchar(100) character set utf8 collate utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;After a fresh install of CI and Codex that works fine, I put in /codex/definitions/ the file gallery.yml and I get that error, whatever I put in the .yml file.
The url in Codex is:
<a href="http://localhost/codex/backend.php/?c=crud&m=index&t=gallery">http://localhost/codex/backend.php/?c=crud&m=index&t=gallery</a>#194 / Mar 25, 2008 1:33pm
Please check that your YML file doesn’t have tabs (use spaces only)
Also please check your base urls if they’re correct. Post again if it doesn’t work 😊
#195 / Mar 25, 2008 1:37pm
well yes, if you create an empty gallery.yml file, it will assume that’s where you have all your configuration, and it will attempt to load it from there.
You need to include all the required parameters in the YML file: db_table, controller_name, and form_setup