Re: [symfony-users] edit id in admin

2010-05-22 Thread Mihai Rusoaie
Hello!

Thanks, Gabriel! I will try that!

Tom: we have a very twisted sales team :)

We send the sales guys in the field with pre-filled contracts to be signed.
We number these contracts each morning with consecutive numbers: 1,2,3,4 and
we insert them in the DB and associate with potential customers. When they
come back to the office in the evening we realise that customer with
contract 2 changed his mind and do not want to sign, so the sales guy
deletes it from the database. But the accounting cannot accept that a
contract is missing from the numbering. And the MySQL autoincrement does not
count that a number is missing so the next contract will have no. 5. Which
has to be changed by our back-office support to 2. There would be another
way not to use the id for contract number; but it's easier and more
intuitive...

Hope I was clear,

Mihai Rusoaie
+40 72 RUSOAIE
www.rusoaie.com


On Fri, May 21, 2010 at 9:14 PM, Tom Haskins-Vaughan 
t...@templestreetmedia.com wrote:

 I'm intrigued...why would you want to change the id?

 On Fri, May 21, 2010 at 1:51 PM, Mihai Rusoaie mi...@rusoaie.com wrote:
  Hello!
 
  When I insert an new object in the database, I want the id to be
  assigned automatically (autoincrement).
 
  In the edit form, however, I want to be able to change the id.
 
  I tried to override the BaseForm class widget and validator with:
 
 $this-widgetSchema['id'] = new sfWidgetFormInputText();
 $this-validatorSchema['id'] = new sfValidatorString();
 
   but with no success (I could see field 'id' in my form, but symfony
  won't write it in the DB).
 
  Thank you!
 
  Mihai
 
  --
  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.comsymfony-users%2bunsubscr...@googlegroups.com
  For more options, visit this group at
  http://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.comsymfony-users%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://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] edit id in admin

2010-05-21 Thread Mihai Rusoaie
Hello!

When I insert an new object in the database, I want the id to be
assigned automatically (autoincrement).

In the edit form, however, I want to be able to change the id.

I tried to override the BaseForm class widget and validator with:

$this-widgetSchema['id'] = new sfWidgetFormInputText();
$this-validatorSchema['id'] = new sfValidatorString();

 but with no success (I could see field 'id' in my form, but symfony
won't write it in the DB).

Thank you!

Mihai

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


Re: [symfony-users] edit id in admin

2010-05-21 Thread Tom Haskins-Vaughan
I'm intrigued...why would you want to change the id?

On Fri, May 21, 2010 at 1:51 PM, Mihai Rusoaie mi...@rusoaie.com wrote:
 Hello!

 When I insert an new object in the database, I want the id to be
 assigned automatically (autoincrement).

 In the edit form, however, I want to be able to change the id.

 I tried to override the BaseForm class widget and validator with:

        $this-widgetSchema['id'] = new sfWidgetFormInputText();
        $this-validatorSchema['id'] = new sfValidatorString();

  but with no success (I could see field 'id' in my form, but symfony
 won't write it in the DB).

 Thank you!

 Mihai

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


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