Am 12.12.2009 10:43, schrieb Georg Gell:
> +1,
>
> IMO by default it should not be displayed in autogenerated fields,
> because those fields are automatically filled, and should not be
> overwritten normally by hand. Think of it in terms of audit reliability,
> would you believe a system where those values can be changed in the
> basic admin form?
> Ideally for me would be an additional option in the Timestampable behavior:
>
>    actAs:
> # ...
>      Timestampable:
>        created:
>          name: created_at
>          type: timestamp
>          format: Y-m-d H
>          show_in_admin_form: false
>        updated:
>          disabled: true
>
> And a postconfig listener would just unset the field in the admin form
> if the option 'show_in_admin_form' is false (which should be the default
> behavior).

I'd go one step further and allow general unsetting of form fields in 
the schema (this can be useful for more than the *_at fields!). If I 
know I will never need this field inside my forms I can simply remove it 
and reduce unnecessary overhead. In my experience there's an average of 
10-20% of fields I have to disable in my forms. It's just bad smell to 
instanciate form fields and validators just to kill them immediately.

example:

   SomeClass:
     ...
     some_field_i_wont_need_in_any_form:
       type:      varchar(50)
       default:   something
       symfony:
         show_in_form:  false

And of course also as parameter to the behaviors as shown by you.

This would require both the Doctrine and Propel form generators to 
accept the option, but it would reduce unnecessary code that would only 
have to be disabled afterwards.

It could be one step further after the great option to disable form 
generation for specific classes that was introduced in 1.3.

David

--

You received this message because you are subscribed to the Google Groups 
"symfony developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-devs?hl=en.


Reply via email to