Re: general model association/SQL question: linking one table to many others

2010-04-14 Thread Vadim Frolov
yes, I do so because I want to translate my phrases. I would use CakePHP to
translate interface, but also want my actual data to be in several
languages. Seems that creating additional table for each field is the only
way to go =(

Regards,
Vadim.

On 15 April 2010 04:44, cricket  wrote:

>
> This is a bit backwards but I think it would work.
>
> Car model:
>
> var $belongsTo = array(
>'CarName' => array(
>'className' => 'Phrase',
>'foreignKey' => 'name_id'
>),
>'CarDescription' => array(
>'className' => 'Phrase',
>'foreignKey' => 'description_id'
>)
> );
>
> The scenario you describe seems a little messy though. Maybe there's a
> better approach. Does this concern translations?
>

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 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

To unsubscribe, reply using "remove me" as the subject.


general model association/SQL question: linking one table to many others

2010-04-14 Thread Vadim Frolov
Hi!

I have a table phrases. It has fields id as INT and value as TEXT. This
table is used to store different phrases or sentences. Now I want to
describe a car with a model name and description. I want both these values
to reference phrases table. In my opinion Car hasOne name and hasOne
description. But it seems that in SQL/CakePHP notation it is not true. To
make hasOne in Cake I would need to add field car_id in my phrases table.
Then if I introduce the table cities also with name and description, I would
need additional rows in phrases table...

I think that I can create additional tables cars_names and cars_descriptions
and connect them through HABTM association with cards and phrases. But I
find inconvenient to create additional table for every phrase field  I want
to add.

Maybe someone knows what can I do in this situation?

Regards,
Vadim.

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 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

To unsubscribe, reply using "remove me" as the subject.


Re: Any popular Image Components being used that are better than the rest?

2010-04-08 Thread Vadim Frolov
MeioUpload  could help

Vadim.

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 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

To unsubscribe, reply using "remove me" as the subject.


Re: Behaviour is not attached automaticaly

2010-03-24 Thread Vadim Frolov
I can't believe I was so blind! Thanks a lot! This is definitely the cause.

Vadim.

On 24 March 2010 14:12, Lucca Mordente  wrote:

> Aren't you working with the wrong model?
> The model you created is being called Photos and you are using Photo
> on tour controller.
>
> Lucca Mordente
>
>
> On 24 mar, 07:13, Vadim Frolov  wrote:
> > Hi all!
> >
> > I created a simple model:
> > class Photos extends AppModel {
> >  var $name = 'Photos';
> >  var $actsAs = array('Aircraft');
> >
> > }
> >
> > Put file 'aircraft.php' in app/models/behaviors'. It has only one method:
> > class AircraftBehavior extends ModelBehavior
> > {
> > function setup(&$model, $settings = array())
> > {
> > }
> >
> > function flyto(&$model, $from, $to)
> > {
> >  echo "Flying from {$from} to {$to} \n";
> > }
> >
> > }
> >
> > Then in my PhotosController I do call "$this->Photo->flyto("toronto",
> > "monreal");" and get the error "SQL Error: 1064: You have an error in
> your
> > SQL syntax; check the manual that corresponds to your MySQL server
> version
> > for the right syntax to use near 'flyto' at line 1". It seems that the
> > method "flyto" is treated as SQL command.
> >
> > If I add $this->Photo->Behaviors->attach('Aircraft');" before actual call
> of
> > "flyto" method, then everything is all right. Why can this happens, that
> > "actAs" does nothing?
> >
> > Best regards,
> > Vadim.
>
> 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 cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>
> To unsubscribe from this group, send email to cake-php+
> unsubscribegooglegroups.com or reply to this email with the words "REMOVE
> ME" as the subject.
>

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 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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Behaviour is not attached automaticaly

2010-03-24 Thread Vadim Frolov
Hi all!

I created a simple model:
class Photos extends AppModel {
 var $name = 'Photos';
 var $actsAs = array('Aircraft');
}

Put file 'aircraft.php' in app/models/behaviors'. It has only one method:
class AircraftBehavior extends ModelBehavior
{
function setup(&$model, $settings = array())
{
}

function flyto(&$model, $from, $to)
{
 echo "Flying from {$from} to {$to} \n";
}
}

Then in my PhotosController I do call "$this->Photo->flyto("toronto",
"monreal");" and get the error "SQL Error: 1064: You have an error in your
SQL syntax; check the manual that corresponds to your MySQL server version
for the right syntax to use near 'flyto' at line 1". It seems that the
method "flyto" is treated as SQL command.

If I add $this->Photo->Behaviors->attach('Aircraft');" before actual call of
"flyto" method, then everything is all right. Why can this happens, that
"actAs" does nothing?

Best regards,
Vadim.

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 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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Is there Dual Select Box for CakePHP?

2010-03-23 Thread Vadim Frolov
Thanks, Nick. I also did some search on this. Seems that jQuery is a way to
go. It has several nice plugins to do this.
Just some more linke for those who may need this too:
http://wheresrhys.co.uk/resources/crossSelect/crossSelect.html
http://plugins.jquery.com/project/comboselect

Vadim.

On 23 March 2010 04:08, nurvzy  wrote:

> Found one:
> http://gsgd.co.uk/sandbox/jquery/picklists/
>
> Nick
>
>
> On Mar 22, 9:04 pm, nurvzy  wrote:
> > That's really a javascript thing more than a CakePHP thing.  A few
> > years back I had a client who wanted the same type of thing.  I ended
> > up writing a nice little prototype-js class that I could use whenever
> > I needed by just passing in the two select list ids in.
> >
> > Unfortunately, it was for a rather paranoid client and I was unable to
> > open source it, but it certainly wasn't rocket science.  A quick
> > google search led me to this:
> http://javascript.internet.com/miscellaneous/move-dual-list.html
> >
> > It's not nearly as nice, but it might give you a place to start.
> >
> > Another thought, I'm a prototype guy, but I know most people here are
> > jQuery freaks, and this is the type of thing I'm sure jQuery people
> > have already done as a nice plugin.  Any of you jQuery people know of
> > a nice dual select box plugin?
> >
> > Nick
> >
> > On Mar 22, 12:33 am, Vadim Frolov  wrote:
> >
> > > Hi there!
> >
> > > Maybe someone of you know the realization of dual select boxes idea.
> Such
> > > control is used for example in ASP.NET (
> http://www.asp.net/community/control-gallery/Item.aspx?i=642). I would
> like
> > > to have two areas: left area contains all available for selection
> items,
> > > right one contains selected items.
> >
> > > Of course, one could implement it by himself, but I would rather use
> (and
> > > modify) existing code than reinvent the wheel.
> >
> > > Best regards,
> > > Vadim Frolov.
>
> 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 cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>
> To unsubscribe from this group, send email to cake-php+
> unsubscribegooglegroups.com or reply to this email with the words "REMOVE
> ME" as the subject.
>

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 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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Is there Dual Select Box for CakePHP?

2010-03-21 Thread Vadim Frolov
Hi there!

Maybe someone of you know the realization of dual select boxes idea. Such
control is used for example in ASP.NET (
http://www.asp.net/community/control-gallery/Item.aspx?i=642). I would like
to have two areas: left area contains all available for selection items,
right one contains selected items.

Of course, one could implement it by himself, but I would rather use (and
modify) existing code than reinvent the wheel.

Best regards,
Vadim Frolov.

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 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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Odd error: Database table names for model Name was not found.

2010-03-12 Thread Vadim Frolov
Hi Chris,

thanks for the tips. It turned out the problem was in the model definition
and table relations. I had a relation with name 'Name', but the actual table
I built my relation on has another name. In such a case the property
'className' should be modified accordingly.

Best regards,
Vadim

On 12 March 2010 15:26, Bailey  wrote:

> Hi Vadim.. i'm still learning cake and have had a similar error to
> this.. some things to do / check:
>
> *Permissions on the user to those database tables / database (does it
> have create / read access)
> *Tables following cake naming format, i.e. Model = Test, Table = Tests
> *Try clearing the cache in /app/tmp/cache/ for the specific tables
>
> Do you get this error with an unbaked model? be interesting to know..
> personally i've never used the bakery facility  so i'm not entirely
> sure if theres any differences..
>
> Hope this helps a bit,
> Chris
>
> On Mar 12, 2:05 pm, Vadim Frolov  wrote:
> > Hi there!
> >
> > I am stuck with this strange problem. I installed CakePHP 1.2.6, database
> > connection is OK. I baked some models, controllers, view, e.t.c. Then I
> go
> > tohttp://localhost/cake/usersand get the error "Database table names for
> > model Name was not found.". I get this error with any baked model.
> >
> > If I change database.php and broke the MySQL connection, then I get the
> > error with the correct model and table name.
> >
> > Maybe someone had such a problem before?
> >
> > Thanks,
> > Vadim Frolov.
>
> 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 cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

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 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


Odd error: Database table names for model Name was not found.

2010-03-12 Thread Vadim Frolov
Hi there!

I am stuck with this strange problem. I installed CakePHP 1.2.6, database
connection is OK. I baked some models, controllers, view, e.t.c. Then I go
to http://localhost/cake/users and get the error "Database table names for
model Name was not found.". I get this error with any baked model.

If I change database.php and broke the MySQL connection, then I get the
error with the correct model and table name.

Maybe someone had such a problem before?

Thanks,
Vadim Frolov.

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 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


Re: FormHelper select without hidden field

2010-01-17 Thread Vadim Frolov
Found out what it was. I used attribute 'multiple' with my select. Removing
this attribute makes what I wanted..

2010/1/17 fralik 

> Hi!
>
> I want to make a GET form with a select field. If I write for example
> $form->select('language', ...), then I will have an output like this:
> 
> 
>one
>two
> 
> So, I selected the first value and submit the form. I will get
> something like this in the address bar "http://example.com/controller/
> action?language=&language%5B%5D=1"
>
> However, I would like it to be like this: "http://example.com/
> controller/action?language=1". Did anybody run into this issue? Until
> now I have only one possible solution. That is not to use FormHelper
> to create select control and to create it manually.
>
> Thank you in advance!
>
> 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 cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>
>
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 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