Development

#2390 (Distinct edit and create configuration with admin generator)

You must first sign up to be able to contribute.

Ticket #2390 (closed enhancement: fixed)

Opened 2 years ago

Last modified 1 year ago

Distinct edit and create configuration with admin generator

Reported by: sorac Assigned to: fabien
Priority: minor Milestone: 1.2.0
Component: generator Version: 1.1.0 DEV
Keywords: admin generator edit create Cc:
Qualification: Design decision

Description

I'm starting to use the admin generator, but I found a problem :

Actually, the create action just contain a forward to the edit action but in some case, I need a completely different configuration between this two actions. Example :

- I have fields that haven't to be update after their creation ( for foreign key integrity) - Some custom actions have to be enabled only on existing items ( ex : a "close ticket" action)

What am I proposing is the creation of a new configuration section in the generator.yml for the create action and, to keep the compatibility with the existing generator, a default value for this section to "edit" to forward create action to edit action.

Here is an example :

generator:
  class:              sfPropelAdminGenerator
  param:
    model_class:      Book
    theme:            default
    
    list:
      display: [id, author_id, title]
      object_actions:
        _edit:

    edit:
      display: [id, author_id, title]
      fields:
        author_id: { params: disabled=true } ## We haven't to change the author of an existing book
        id:        { params: disabled=true } ## Don't touch the primary key
      actions:
        _list:
        _save:

    create:
      display: [author_id, title] ## Don't need to show the primary key
      actions:
        _list:
        _save:

Change History

03/17/08 23:57:05 changed by smartin

This would indeed be a very interesting feature. Yet, it's already 5 months ago that this was suggested.

06/18/08 22:18:02 changed by dbrewer

+1 for this feature. I was just now trying to figure out how to make a different title for the 'create' mode than you do for the 'edit' mode and came across this ticket.

06/23/08 07:07:21 changed by dwhittle

  • version set to 1.1.0 DEV.
  • qualification changed from Unreviewed to Design decision.
  • milestone set to 1.2.0.

07/05/08 13:54:07 changed by carmina1

Think it's going to be very useful or user management :

  • when you create a user, you set and confirm a password
  • when you edit a user, you don't show the password at all.

10/30/08 13:23:07 changed by fabien

  • status changed from new to closed.
  • resolution set to fixed.

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.