[symfony-users] tinyMCE jQuery + symfony 1.4

2010-05-22 Thread godbout
Hi!

I've got some problems to make the tinyMCE jQuery works. I've
installed the FormExtra plugin, edited the view YAML, and used the
widget. I have a javascript error telling me that .tinyMCE is not
declared and by checking the javascript I can see that it refers to
the basic tinyMCE javascript but not to the jQuery one. The thing is
then, I guess I have to extend the tinyMCE widget that is coming with
FormExtra, but I have no idea how to do that.

Do I have to create a new widget that extend the tinyMCE?
Where do I put the new class files?

I've read some stuff and I kind of understand I need to create the
configure and render class, but I can't find a really good explanation
in the docs.

Thanks in advance!

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: How overwrite addFiltersCriteria in symfony 1.4?

2010-05-09 Thread godbout
Hi there,

I join the discussion because I have a problem with those
addXXXColumnQuery.
I want to add some criteria to a table that is in join and I can't
find a correct way to find the alias of that class.
Any idea?

On May 7, 1:20 pm, Richtermeister  wrote:
> Hey there,
>
> assuming you're using doctrine or propel, the autogenerated forms
> would be in /lib/forms/base
>
> Daniel
>
> On May 6, 10:48 am, fRAnKEnSTEin  wrote:
>
>
>
>
>
> > Hi there,
>
> > Thank you very much for your help:
>
> > >"...that is why some filter inputs (like the date filter field for 
> > >example) have 2 fields with the same name..."
>
> > Nice piece of info!. Ok you suggested me that i can take a look at the
> > auto-generated forms. I have searched in "cache" folder for the auto-
> > generated code, but i can not find the forms code that you suggested
> > me to read. I have searched in the next folders:
>
> > in "cache" folder:
>
> > myModule/actions
> > myModule/lib
> > myModule/Templates
>
> > and in these other folders too:
>
> > mySite/lib/filter
> > mySite/lib/form
>
> > And nothing. I need to find the auto-generated code to see how they
> > created the widget with the same name etc etc.
>
> > Can you tell me where i have to find these auto-generated forms.
>
> > Cheers
>
> > --
> > If you want to report a vulnerability issue on symfony, please send it to 
> > security at symfony-project.com
>
> > You received this message because you are subscribed to the Google
> > Groups "symfony users" group.
> > To post to this group, send email to symfony-users@googlegroups.com
> > To unsubscribe from this group, send email to
> > symfony-users+unsubscr...@googlegroups.com
> > For more options, visit this group 
> > athttp://groups.google.com/group/symfony-users?hl=en
>
> --
> If you want to report a vulnerability issue on symfony, please send it to 
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to symfony-users@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com
> For more options, visit this group 
> athttp://groups.google.com/group/symfony-users?hl=en

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: Unavailable and Error page - can't use helpers or else?

2010-04-29 Thread godbout
I would add a small question there:

I have several app. I want to use the same custom 404 page for
example, without copying/pasting for each app. Possible?
Doesn't it make more sense to be able to define this in the global
config?


On Apr 22, 10:24 am, godbout  wrote:
> Hi!
>
> I'm customizing my error and unavailable page and I'm a bit surprised
> to see that the include_stylesheet and other helpers don't work. I
> want to use the same sheets that for my app. Can't I use any symfony
> framework functionalities in those 2 files?
>
> Thx,
> Cheers
>
> --
> If you want to report a vulnerability issue on symfony, please send it to 
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to symfony-users@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com
> For more options, visit this group 
> athttp://groups.google.com/group/symfony-users?hl=en

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: Seems like Doctrine is building my filters on an old schema?

2010-04-27 Thread godbout
Ok, found a way to correct that.
I've added the local and foreign id in the many-to-many relationships.
I've got an old table where I haven't updated the sf_guard_user_id to
user_id because i'm gonna drop it later, and it seems that when I
don't specify a local/foreign_id Doctrine is using this one instead of
the new user_id.

This might help some other people!
Cheers,


On Apr 27, 5:40 pm, godbout  wrote:
> Hello Sir,
>
> I used to have a backend module generated by the doctrine admin-gen.
> I've changed the schema to replace the sf_guard_user_id in one of the
> table by a user_id.
>
> Here is the old schema:
>
> SectionUser:
>   columns:
>     sf_guard_user_id:                { type: integer(4), notnull:
> true }
>     section_id:             { type: integer(4), notnull: true }
>     type:                   { type: enum, length: 20, values:
> ['TEACHER', 'STUDENT', 'OTHER'] }
>   relations:
>     Section:                { local: section_id, foreign: id, class:
> Section, foreignAlias: SectionUsers, onDelete: CASCADE }
>     User:                   { local: sf_guard_user_id, foreign: id,
> class: sfGuardUser, foreignAlias: SectionUsers, onDelete: CASCADE }
>
> Here is the new one:
>
> SectionUser:
>   columns:
>     user_id:                { type: integer(4), notnull: true }
>     section_id:             { type: integer(4), notnull: true }
>     type:                   { type: enum, length: 20, values:
> ['TEACHER', 'STUDENT', 'OTHER'] }
>   relations:
>     Section:                { local: section_id, foreign: id, class:
> Section, foreignAlias: SectionUsers, onDelete: CASCADE }
>     User:                   { local: user_id, foreign: id, class:
> sfGuardUser, foreignAlias: SectionUsers, onDelete: CASCADE }
>
> Migrations classes have been build and run, no pb.
>
> However now I have problem with the sources. When I do a
> doctrine:build --all-classes, here is what I find in a
> BaseSectionFormFilter.class.php:
>
> public function addUsersListColumnQuery(Doctrine_Query $query, $field,
> $values)
>   {
>     if (!is_array($values))
>     {
>       $values = array($values);
>     }
>
>     if (!count($values))
>     {
>       return;
>     }
>
>     $query->leftJoin('r.SectionUser SectionUser')
>           ->andWhereIn('SectionUser.sf_guard_user_id', $values);
>   }
>
> Of course the reference to sf_guard_user_id crashes, it should be
> user_id.
>
> I've tried any cc, clean-model-files, etc... but without success. Any
> idea?
>
> Thx in advance,
> Guill
>
> --
> If you want to report a vulnerability issue on symfony, please send it to 
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to symfony-users@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com
> For more options, visit this group 
> athttp://groups.google.com/group/symfony-users?hl=en

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Seems like Doctrine is building my filters on an old schema?

2010-04-27 Thread godbout
Hello Sir,

I used to have a backend module generated by the doctrine admin-gen.
I've changed the schema to replace the sf_guard_user_id in one of the
table by a user_id.

Here is the old schema:

SectionUser:
  columns:
sf_guard_user_id:{ type: integer(4), notnull:
true }
section_id: { type: integer(4), notnull: true }
type:   { type: enum, length: 20, values:
['TEACHER', 'STUDENT', 'OTHER'] }
  relations:
Section:{ local: section_id, foreign: id, class:
Section, foreignAlias: SectionUsers, onDelete: CASCADE }
User:   { local: sf_guard_user_id, foreign: id,
class: sfGuardUser, foreignAlias: SectionUsers, onDelete: CASCADE }

Here is the new one:

SectionUser:
  columns:
user_id:{ type: integer(4), notnull: true }
section_id: { type: integer(4), notnull: true }
type:   { type: enum, length: 20, values:
['TEACHER', 'STUDENT', 'OTHER'] }
  relations:
Section:{ local: section_id, foreign: id, class:
Section, foreignAlias: SectionUsers, onDelete: CASCADE }
User:   { local: user_id, foreign: id, class:
sfGuardUser, foreignAlias: SectionUsers, onDelete: CASCADE }

Migrations classes have been build and run, no pb.

However now I have problem with the sources. When I do a
doctrine:build --all-classes, here is what I find in a
BaseSectionFormFilter.class.php:

public function addUsersListColumnQuery(Doctrine_Query $query, $field,
$values)
  {
if (!is_array($values))
{
  $values = array($values);
}

if (!count($values))
{
  return;
}

$query->leftJoin('r.SectionUser SectionUser')
  ->andWhereIn('SectionUser.sf_guard_user_id', $values);
  }

Of course the reference to sf_guard_user_id crashes, it should be
user_id.

I've tried any cc, clean-model-files, etc... but without success. Any
idea?

Thx in advance,
Guill

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: Database changes

2010-04-21 Thread godbout
Yeah, and it looks like it's the same guy that is asking the same
thing over and over...

http://groups.google.com/group/symfony-users/browse_thread/thread/6f50773c4d21d00/0b0195e283f7cacb?lnk=gst&q=Parijat+Kalia#0b0195e283f7cacb


On Apr 22, 10:09 am, Eno  wrote:
> On Wed, 21 Apr 2010, Parijat Kalia wrote:
> > The one sucky part about symfony for me is how to handle database changes. I
> > mean, if I need to go about changing db fields, then must i loose all my
> > existing data?
>
> >  I am sure there is a very easy way around this, coz if there is a long way
> > around it, then that would be crazy as db changes happen all the time.
>
> Migrations are your friend. (If you're still using Propel, then this might
> be incentive to switch to Doctrine :-)
>
> http://www.doctrine-project.org/documentation/cookbook/1_0/en/symfony...
>
> This questions comes up on the list every month or two...
>
> --
>
> --
> If you want to report a vulnerability issue on symfony, please send it to 
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to symfony-users@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com
> For more options, visit this group 
> athttp://groups.google.com/group/symfony-users?hl=en

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Unavailable and Error page - can't use helpers or else?

2010-04-21 Thread godbout
Hi!

I'm customizing my error and unavailable page and I'm a bit surprised
to see that the include_stylesheet and other helpers don't work. I
want to use the same sheets that for my app. Can't I use any symfony
framework functionalities in those 2 files?

Thx,
Cheers

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: sfValidatorDoctrineUnique doesn't work when only defined in BaseForm?

2010-04-12 Thread godbout
Sure.

// BaseSubscriberForm.class.php --

abstract class BaseSubscriberForm extends BaseFormDoctrine
{
  public function setup()
  {
$this->setWidgets(array(
  'id' => new sfWidgetFormInputHidden(),
  'email'  => new sfWidgetFormInputText(),
  'deleted_at' => new sfWidgetFormDateTime(),
  'created_at' => new sfWidgetFormDateTime(),
  'updated_at' => new sfWidgetFormDateTime(),
));

$this->setValidators(array(
  'id' => new sfValidatorDoctrineChoice(array('model' =>
$this->getModelName(), 'column' => 'id', 'required' => false)),
  'email'  => new sfValidatorString(array('max_length' =>
255)),
  'deleted_at' => new sfValidatorDateTime(array('required' =>
false)),
  'created_at' => new sfValidatorDateTime(),
  'updated_at' => new sfValidatorDateTime(),
));

$this->validatorSchema->setPostValidator(
  new sfValidatorDoctrineUnique(array('model' => 'Subscriber',
'column' => array('email')))
);

$this->widgetSchema->setNameFormat('subscriber[%s]');

$this->errorSchema = new sfValidatorErrorSchema($this-
>validatorSchema);

$this->setupInheritance();

parent::setup();
  }

  public function getModelName()
  {
return 'Subscriber';
  }

}


// SubscriberForm.class.php --
class SubscriberForm extends BaseSubscriberForm
{
  public function configure()
  {
unset($this['id'], $this['deleted_at'], $this['created_at'],
$this['updated_at']);

$this->widgetSchema->setLabel('email', 'Your email');

$this->setValidators(array(
  'email' => new sfValidatorEmail(array('trim' => true), array(
'required'  => 'Forgot to type your email? Try again! ',
'invalid'   => 'Oups, this doesn\'t look like a valid email.
Try again!'
  )),
));

$this->validatorSchema->setPostValidator(
  new sfValidatorDoctrineUnique(array('model' => 'Subscriber',
'column' => array('email')))
);

$this->widgetSchema->setFormFormatterName('list');
  }

}

As you can see the PostValidator is the same. If I don't put it in
SubscriberForm it doesn't work.



On Apr 12, 6:52 pm, Alan Bem  wrote:
> Can you put somewhere code of those classes?
>
> Alan
>
> On Mon, Apr 12, 2010 at 5:00 AM, godbout wrote:
>
>
>
> > Hi Alan,
>
> > Obviously I wasn't really awake that day...
> > The form is SubscriberForm (not NewsletterForm) and it extends
> > BaseSubscriberForm.
> > I had to copy/paste the code from BaseSubscriberForm to SubscriberForm
> > to make it work.
>
> > On Apr 11, 8:37 pm, Alan Bem  wrote:
> > > Aren't you talking about two different Forms? It seems that first
> > > post-validator comes from (Base)SubscriberForm, but you complaint about
> > > NewsletterForm.
> > > Is there inheritance relationship beetween them?
>
> > > Cheers
>
> > > On Sat, Apr 10, 2010 at 5:05 PM, godbout  > >wrote:
>
> > > > Hi there!
>
> > > > I have a very simple thing to do: allowing visitors to register their
> > > > email for a newsletter.
> > > > The email field is defined as unique in the db, and Doctrine created
> > > > me the BaseForm with the following code:...
>
> > > > [code]$this->validatorSchema->setPostValidator(
> > > >      new sfValidatorDoctrineUnique(array('model' => 'Subscriber',
> > > > 'column' => array('email')))
> > > >    );
> > > > [/code]
>
> > > > ...which is exactly what I want. But it didn't work until I copy/
> > > > pasted exactly the same code in my NewsletterForm.
>
> > > > Any explanation for that?
> > > > My NewsletterForm doesn't contain much, but it redefined the email
> > > > field validator from ValidatorString to ValidatorEmail. Would that
> > > > cause the problem? I'm still surprised.
>
> > > > Let me know if you have an idea ;-)
>
> > > > Guill
>
> > > > --
> > > > If you want to report a vulnerability issue on symfony, please send it
> > to
> > > > security at symfony-project.com
>
> > > > You received th

[symfony-users] Re: sfValidatorDoctrineUnique doesn't work when only defined in BaseForm?

2010-04-11 Thread godbout
Hi Alan,

Obviously I wasn't really awake that day...
The form is SubscriberForm (not NewsletterForm) and it extends
BaseSubscriberForm.
I had to copy/paste the code from BaseSubscriberForm to SubscriberForm
to make it work.


On Apr 11, 8:37 pm, Alan Bem  wrote:
> Aren't you talking about two different Forms? It seems that first
> post-validator comes from (Base)SubscriberForm, but you complaint about
> NewsletterForm.
> Is there inheritance relationship beetween them?
>
> Cheers
>
> On Sat, Apr 10, 2010 at 5:05 PM, godbout wrote:
>
>
>
> > Hi there!
>
> > I have a very simple thing to do: allowing visitors to register their
> > email for a newsletter.
> > The email field is defined as unique in the db, and Doctrine created
> > me the BaseForm with the following code:...
>
> > [code]$this->validatorSchema->setPostValidator(
> >      new sfValidatorDoctrineUnique(array('model' => 'Subscriber',
> > 'column' => array('email')))
> >    );
> > [/code]
>
> > ...which is exactly what I want. But it didn't work until I copy/
> > pasted exactly the same code in my NewsletterForm.
>
> > Any explanation for that?
> > My NewsletterForm doesn't contain much, but it redefined the email
> > field validator from ValidatorString to ValidatorEmail. Would that
> > cause the problem? I'm still surprised.
>
> > Let me know if you have an idea ;-)
>
> > Guill
>
> > --
> > If you want to report a vulnerability issue on symfony, please send it to
> > security at symfony-project.com
>
> > You received this message because you are subscribed to the Google
> > Groups "symfony users" group.
> > To post to this group, send email to symfony-users@googlegroups.com
> > To unsubscribe from this group, send email to
> > symfony-users+unsubscr...@googlegroups.com > legroups.com>
> > For more options, visit this group at
> >http://groups.google.com/group/symfony-users?hl=en
>
> > To unsubscribe, reply using "remove me" as the subject.

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] sfValidatorDoctrineUnique doesn't work when only defined in BaseForm?

2010-04-10 Thread godbout
Hi there!

I have a very simple thing to do: allowing visitors to register their
email for a newsletter.
The email field is defined as unique in the db, and Doctrine created
me the BaseForm with the following code:...

[code]$this->validatorSchema->setPostValidator(
  new sfValidatorDoctrineUnique(array('model' => 'Subscriber',
'column' => array('email')))
);
[/code]

...which is exactly what I want. But it didn't work until I copy/
pasted exactly the same code in my NewsletterForm.

Any explanation for that?
My NewsletterForm doesn't contain much, but it redefined the email
field validator from ValidatorString to ValidatorEmail. Would that
cause the problem? I'm still surprised.

Let me know if you have an idea ;-)

Guill

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

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


[symfony-users] Re: Unable to use namespaces with symfony

2010-04-06 Thread godbout
If I'm not talking crazy, namespaces are available in symfony 2 using
php 5.3.
I wouldn't expect them to work in 1.4 yet.


On Apr 3, 11:25 pm, Amadeus  wrote:
> Hi
>
> I am trying to use classes with namespaces such as Doctrine 2 or my
> own stuff but not matter what I use symfony gives me a Fatal Error:
> cannot redeclare class XYZ...   Does anyone have an idea? The autoload
> config and cache only have one instance of the file in question.
> Somehow its trying to load it again. Are namespaces not possible with
> Symfony 1.4?

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: How to use one connection for generated migration diff files

2010-03-26 Thread godbout
Wondering also. Seems there is no "connection" option from the
doctrine:migrate task, looking at the help.


On Mar 25, 6:44 pm, jp_morvan  wrote:
> Hi,
>
> I've two connections in databases.yml :
> all:
>   connection1:
>     class: sfDoctrineDatabase
>     param:
>       dsn: 'mysql:host=myhost;dbname=dbname1;'
>       username: username
>       password: pwd
>   connection2:
>     class: sfDoctrineDatabase
>     param:
>       dsn: 'mysql:host=myhost;dbname=dbname2;'
>       username: username
>       password: pwd
>
> I've changed some stuff in schema.yml (add foreign key on one table
> from connection2 to another table from connection 1).
>
> If I build all, there is no problem, relation is good. But I don't
> want to.
>
> I used symfony doctrine:generate-migrations-diff. So, I've now 2
> generated migrations files.
>
> But I don't find where I can say that this migration action have to
> use connection1 and this other action have to use connection2.
>
> Have you an idea ?

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

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


[symfony-users] Re: Losing data upon creating new tables

2010-03-26 Thread godbout
Parijat,

Follow the doc given by Tom.
Then, once you understand, just remember that for creating the
migration classes correctly you will have to do that in the correct
order:
1 - your schema yml files and your database structure should match
2 - update the classes to match your schema yml by doing a
doctrine:build --all-classes
3 - modify your schema yml files according to your needs
4 - run the task doctrine:generate-migrations-diff. This is gonna
check the differences between your model files and your schema yml
files and create the migration classes for you that will help you
migrate the database. That is why it's important that at the
beginning, your classes, your schema and your db match (happens when
you do step 1 and 2)
5 - once the migration classes are generated, you can try to run the
migration by doctrine:migrate
6 - if it works, update your classes to match the new schema yml files
(doctrine:build --all-classes). if it doesn't, you have to correct the
stuff manually (db and/or migrations classes). Update your classes
ONLY if migration worked. Else, you'll not be able to generate the
classes again (because your schema files and your model classes will
match)

Let me know if you get it.

Cheers,
Guill



On Mar 25, 6:29 am, Tom Haskins-Vaughan 
wrote:
> http://www.symfony-project.org/doctrine/1_2/en/07-Migrations
>
> I don't know if there are any major differences for sf1.4.
>
>
>
> On Wed, Mar 24, 2010 at 4:53 PM, Parijat Kalia  wrote:
> > Migrations? I haven't yet heard of them. Does the book cover it by any
> > chance? Please give me some pointers on where I can learn more about
> > migrations. That would be awesome. Thanks!
>
> > On Wed, Mar 24, 2010 at 11:47 AM, Eno  wrote:
>
> >> On Tue, 23 Mar 2010, Parijat Kalia wrote:
>
> >> > I don't want that to happen. Is symfony trying to tell me that there is
> >> > no
> >> > way around this? That I absolutely must loose all my data so as to be
> >> > able
> >> > to add new data? OMG!
>
> >> That's why migrations in Doctrine rock.
>
> >> --
> >> A
>
> >> --
> >> If you want to report a vulnerability issue on symfony, please send it to
> >> security at symfony-project.com
>
> >> You received this message because you are subscribed to the Google
> >> Groups "symfony users" group.
> >> To post to this group, send email to symfony-users@googlegroups.com
> >> To unsubscribe from this group, send email to
> >> symfony-users+unsubscr...@googlegroups.com
> >> For more options, visit this group at
> >>http://groups.google.com/group/symfony-users?hl=en
>
> >> To unsubscribe from this group, send email to
> >> symfony-users+unsubscribegooglegroups.com or reply to this email with the
> >> words "REMOVE ME" as the subject.
>
> > --
> > If you want to report a vulnerability issue on symfony, please send it to
> > security at symfony-project.com
>
> > You received this message because you are subscribed to the Google
> > Groups "symfony users" group.
> > To post to this group, send email to symfony-users@googlegroups.com
> > To unsubscribe from this group, send email to
> > symfony-users+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/symfony-users?hl=en
>
> > To unsubscribe from this group, send email to
> > symfony-users+unsubscribegooglegroups.com or reply to this email with the
> > words "REMOVE ME" as the subject.

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

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


[symfony-users] Re: symfony and doctrine migrations - who to believe?

2010-03-06 Thread godbout
Got it.
Actually it's not correctly explained in the slides, maybe because
it's quite new?

Anyway here is how it works:
- generate-migrations-db: creates the migration files from the
beginning. So useless if you don't want to drop and re-create the db.
- generate-migrations-models: same thing, but from the models
- generate-migrations-diff: make the diff between the models and the
schema yml files. So as Florian explained, be careful to not build the
models before doing the diff.

But there's the other solution I was looking for: make your own task
with Doctrine_Core::generateMigrationsFromDiff like this:
- Doctrine_Core::generateMigrationsFromDiff('/path/to/migration/
classes', 'doctrine_db_connection_name', '/path/to/schema.yml');

Then the migrations classes will be created, even if your models and
schema are the same, as long as the db is different from the schema!

Guill


On Mar 5, 10:36 am, godbout  wrote:
> Hi Florian!
>
> Thx for the help.
> Yah, you're right, I meant 'generate-migrations-diff'. Was a bit tired
> from the day probably :-p
> Yah, also I got the flow. Actually I think I've found why it didn't
> work, there's an error in the yml file (found when I've tried to build
> the classes anyway).
>
> But it still very blur on the generate-migrations-db and generate-
> migrations-models. Is there any comparison made between the db and the
> yml? Or it is just taking db, or the model, and produce a pile of file
> that just helps you to re-create the db?
>
> Guill
>
> On Mar 5, 4:39 am, Florian  wrote:
>
>
>
> > hi,
>
> > you surely wanted to say 'generate-migrations-diff' in your third
> > try ?
>
> > The "doctrine:generate-migrations-diff" task calculates the difference
> > between your model classes and the yml schema.
>
> > So when you want to modify your model, do this in *this exact order* :
>
> >  - make sure your model is up to date before modifying your schema by
> > calling: "php symfony doctrine:build --all-classes --sql"
> >  - modify your schema.yml with whatever you want
> >  - run "php symfony doctrine:generate-migrations-diff"
> >  - look at your lib/migration/doctrine folder if everything gone fine
>
> > If you build your model before calling "doctrine:generate-migrations-
> > diff", doctrine won't know what has changed and will do nothing.
>
> > Hope it helps!
>
> > Florian
>
> > On 4 mar, 14:38,godbout wrote:
>
> > > Hi guys.
>
> > > I want to use the symfony tasks for the doctrine migration but I can't
> > > find any consistent piece of information.
>
> > > I read this:
> > > -http://www.doctrine-project.org/documentation/manual/1_2/en/migrations
> > > and this:
> > > -http://www.symfony-project.org/reference/1_4/en/16-Tasks#chapter_16_s...
> > > and I've watched these slides:
> > > -http://www.slideshare.net/weaverryan/the-art-of-doctrine-migrations
> > > and those ones:
> > > -http://www.slideshare.net/denderello/symfony-live-2010-using-doctrine...
>
> > > Sometimes it says that the generate-migrations-db will make a
> > > comparison between the db and the schema.yml and generate the classes,
> > > sometimes it says that it will just take the db and make the classes.
> > > I don't see the point of the second information, but this is what
> > > happens for me. Whatever is in the schema.yml is not taken in
> > > consideration, and I end up with migration classes that just create
> > > the same db that I have and not the updates from my yml files.
>
> > > Same thing for generate-migrations-models. My models are the same than
> > > the db, but not than the yml files. But whatever, the migration
> > > classes just a copy of the model and doesn't pay attention to the yml
> > > files.
>
> > > I've tried the last one: generate-migrations-models. According to some
> > > of the links it actually does the difference between the yml files and
> > > the model (well, on some other links it's the definition of the
> > > generate-migrations-models function, so I don't get it...). I can't
> > > really see the model because it lamentably failed with a ToPrfx...
> > > something class not found.
>
> > > Anybody to lighten me up on that?
>
> > > Cheers in advance,
> > > Guill

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: symfony and doctrine migrations - who to believe?

2010-03-04 Thread godbout
Hi Florian!

Thx for the help.
Yah, you're right, I meant 'generate-migrations-diff'. Was a bit tired
from the day probably :-p
Yah, also I got the flow. Actually I think I've found why it didn't
work, there's an error in the yml file (found when I've tried to build
the classes anyway).

But it still very blur on the generate-migrations-db and generate-
migrations-models. Is there any comparison made between the db and the
yml? Or it is just taking db, or the model, and produce a pile of file
that just helps you to re-create the db?

Guill


On Mar 5, 4:39 am, Florian  wrote:
> hi,
>
> you surely wanted to say 'generate-migrations-diff' in your third
> try ?
>
> The "doctrine:generate-migrations-diff" task calculates the difference
> between your model classes and the yml schema.
>
> So when you want to modify your model, do this in *this exact order* :
>
>  - make sure your model is up to date before modifying your schema by
> calling: "php symfony doctrine:build --all-classes --sql"
>  - modify your schema.yml with whatever you want
>  - run "php symfony doctrine:generate-migrations-diff"
>  - look at your lib/migration/doctrine folder if everything gone fine
>
> If you build your model before calling "doctrine:generate-migrations-
> diff", doctrine won't know what has changed and will do nothing.
>
> Hope it helps!
>
> Florian
>
> On 4 mar, 14:38, godbout  wrote:
>
>
>
> > Hi guys.
>
> > I want to use the symfony tasks for the doctrine migration but I can't
> > find any consistent piece of information.
>
> > I read this:
> > -http://www.doctrine-project.org/documentation/manual/1_2/en/migrations
> > and this:
> > -http://www.symfony-project.org/reference/1_4/en/16-Tasks#chapter_16_s...
> > and I've watched these slides:
> > -http://www.slideshare.net/weaverryan/the-art-of-doctrine-migrations
> > and those ones:
> > -http://www.slideshare.net/denderello/symfony-live-2010-using-doctrine...
>
> > Sometimes it says that the generate-migrations-db will make a
> > comparison between the db and the schema.yml and generate the classes,
> > sometimes it says that it will just take the db and make the classes.
> > I don't see the point of the second information, but this is what
> > happens for me. Whatever is in the schema.yml is not taken in
> > consideration, and I end up with migration classes that just create
> > the same db that I have and not the updates from my yml files.
>
> > Same thing for generate-migrations-models. My models are the same than
> > the db, but not than the yml files. But whatever, the migration
> > classes just a copy of the model and doesn't pay attention to the yml
> > files.
>
> > I've tried the last one: generate-migrations-models. According to some
> > of the links it actually does the difference between the yml files and
> > the model (well, on some other links it's the definition of the
> > generate-migrations-models function, so I don't get it...). I can't
> > really see the model because it lamentably failed with a ToPrfx...
> > something class not found.
>
> > Anybody to lighten me up on that?
>
> > Cheers in advance,
> > Guill

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] symfony and doctrine migrations - who to believe?

2010-03-04 Thread godbout
Hi guys.

I want to use the symfony tasks for the doctrine migration but I can't
find any consistent piece of information.

I read this:
- http://www.doctrine-project.org/documentation/manual/1_2/en/migrations
and this:
- 
http://www.symfony-project.org/reference/1_4/en/16-Tasks#chapter_16_sub_doctrine_generate_migrations_db
and I've watched these slides:
- http://www.slideshare.net/weaverryan/the-art-of-doctrine-migrations
and those ones:
- 
http://www.slideshare.net/denderello/symfony-live-2010-using-doctrine-migrations

Sometimes it says that the generate-migrations-db will make a
comparison between the db and the schema.yml and generate the classes,
sometimes it says that it will just take the db and make the classes.
I don't see the point of the second information, but this is what
happens for me. Whatever is in the schema.yml is not taken in
consideration, and I end up with migration classes that just create
the same db that I have and not the updates from my yml files.

Same thing for generate-migrations-models. My models are the same than
the db, but not than the yml files. But whatever, the migration
classes just a copy of the model and doesn't pay attention to the yml
files.

I've tried the last one: generate-migrations-models. According to some
of the links it actually does the difference between the yml files and
the model (well, on some other links it's the definition of the
generate-migrations-models function, so I don't get it...). I can't
really see the model because it lamentably failed with a ToPrfx...
something class not found.

Anybody to lighten me up on that?

Cheers in advance,
Guill

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: doctrine + admin-gen + customize filter + inner join = every table must have its own alias

2010-01-20 Thread godbout
My mistake. The sql query actually works. There is no 'AS' explicitly
written, it's the first time I see a query working like this. But it
does, I just didn't copy it correctly. The problem was something else
and it's resolved.

Thx

On Jan 20, 4:10 pm, godbout  wrote:
> Hi there!
>
> I'm using symfony 1.2 with doctrine.
>
> I'm having trouble trying to customize a filter done by the admin-
> gen.
> I added a sfWidgetFormDoctrineChoice, this works greats. Keys and
> values are ok.
> Then I added to my form filter class a getFields method, and a
> addCodeColumnQuery method.
> My code field comes from another table and I need a inner join to get
> that.
>
> So finally in my addCodeColumnQuery, I add what I need to complete the
> query:
>
> Here's the code:
> ---
> $alias = $query->getRootAlias();
> $query->innerJoin($alias .'.TplProgram T')->addWhere('T.code = "?"',
> $values);
> ---
>
> The sql created by symfony end up being:
> ---
> SELECT COUNT(*) AS num_results FROM (SELECT p.id FROM program_year p
> INNER JOIN tpl_program t ON p.tpl_program_id = t.id WHERE t.code = "?"
> GROUP BY p.id)
> ---
> and that's where the problem is. Mysql refuse to take it as long as I
> don't have a 'AS XXX' at the end of the query.
> How can I add that using the Doctrine_Query type?
>
> Thx a lot in advance!
> Guill
-- 
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




[symfony-users] doctrine + admin-gen + customize filter + inner join = every table must have its own alias

2010-01-20 Thread godbout
Hi there!

I'm using symfony 1.2 with doctrine.

I'm having trouble trying to customize a filter done by the admin-
gen.
I added a sfWidgetFormDoctrineChoice, this works greats. Keys and
values are ok.
Then I added to my form filter class a getFields method, and a
addCodeColumnQuery method.
My code field comes from another table and I need a inner join to get
that.

So finally in my addCodeColumnQuery, I add what I need to complete the
query:

Here's the code:
---
$alias = $query->getRootAlias();
$query->innerJoin($alias .'.TplProgram T')->addWhere('T.code = "?"',
$values);
---

The sql created by symfony end up being:
---
SELECT COUNT(*) AS num_results FROM (SELECT p.id FROM program_year p
INNER JOIN tpl_program t ON p.tpl_program_id = t.id WHERE t.code = "?"
GROUP BY p.id)
---
and that's where the problem is. Mysql refuse to take it as long as I
don't have a 'AS XXX' at the end of the query.
How can I add that using the Doctrine_Query type?

Thx a lot in advance!
Guill
-- 
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




[symfony-users] Jobeet day 7 - can't see how the code can give those screenshots

2009-11-01 Thread godbout

Hi there!

I've got a problem on day 7 that brings me errors on later days when I
run the tests.
I try to explain:

As long as we sort the jobs by 'expires_at DESC', I understand that
the job in 'Sensio Labs' appear first (even if in my case it is not
followed by company 100 but company 114 instead...). But then, how can
this work when, after refactoring, we sort by 'created_at DESC'?

Is it a typing mistake or there is some magic that I don't understand
here?

Thanks in advance!


[code]
public function addActiveJobsQuery(Doctrine_Query $q = null)
  {
if (is_null($q))
{
  $q = Doctrine_Query::create()
->from('JobeetJob j');
}

$alias = $q->getRootAlias();

$q->andWhere($alias . '.expires_at > ?', date('Y-m-d H:i:s', time
()))
  ->addOrderBy($alias . '.created_at DESC');

return $q;
  }
[/code]


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---