On May 18, 5:19 am, Gareth McCumskey <gmccums...@gmail.com> wrote: > Did you rebuild model after changing schema? (propel:build-model)
I just rebuilt the model and that seems to have fixed the problem. I had assumed that the conversion to an integer would have happened in the form class - in the validators. But I guess the model classes do this too. > On Mon, May 18, 2009 at 7:13 AM, Lawrence <lkrub...@geocities.com> wrote: > > > I've got a field that was mistakenly defined in the schema as an > > integer. So the base class looks like this (I'm leaving out the > > irrelevant fields): > > > $this->setWidgets(array( > > 'payment_amount' => new sfWidgetFormInput(), > > )); > > > $this->setValidators(array( > > 'payment_amount' => new sfValidatorInteger(), > > )); > > > This field is suppose to be an amount of cash, so it needs to have a > > decimal in it. When I first tried it, I input 1.5 and I got the error > > "Must be an integer." > > > So I overrode it: > > > $this->widgetSchema['payment_amount'] = new sfWidgetFormInput > > (); > > $this->validatorSchema['payment_amount'] = new sfValidatorString() > > > I no longer get an error but when the form submits, the decimal is > > stripped off and I'm left with an integer. > > > I've changed schema.yml so that payment_amount is now a float. I also > > changed the database itself, so that payment_amount is now a float. > > > Yet the decimal still gets stripped off and it is rendered as an > > integer. Can anyone tell me where else I need to change this? > > -- > Gareth McCumskeyhttp://garethmccumskey.blogspot.com > twitter: @garethmcc --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---