You can use the name of the Class/Table e.g.:

In the file generator.yml

 list:
        display: [id, name, emp]

Please note it is emp, and not emp_id which is the name of the column,
this works for me and it lists the __tostring magic method instead of
the id.

Cheers.


On 9/21/10 7:33 AM, dmitrypol wrote:
> Hi all
> 
> Apologies if this is a silly question.  I am using Symfony 1.4.6 to
> build a simple app to track which team members are working on which
> issues (we need a custom solution).
> 
> Core of my schema.yml:
> issue:
>   columns:
>     name:        { type: string(255), notnull: true, unique: true }
>     emp_id:      { type: integer }
>   relations:
>     emp:         { local: emp_id, foreign: id }
> emp:
>   columns:
>     name:       { type: string(255), notnull: true, unique: true }
> ...
> 
> I execute:
> symfony generate:app frontend
> symfony doctrine:build --all --no-confirmation
> symfony doctrine:generate-admin frontend issue --module=issue
> symfony doctrine:generate-module --with-show frontend issue_module
> issue
> 
> When I browse to http://url.com/frontend_dev.php/issue (or
> issue_module) I see the foreign key IDs of the employees which looks
> silly to the users.
> ID    Name            Emp
> 1     Issue 1         6
> 2     Issue 2         4
> When I browse to http://url.com/frontend_dev.php/issue/new (or
> issue_module/new or edit page) I see a dropdown with the actual names
> of the employees.
> 
> I went through the Jobeet guide (and other docs on symfony site) and
> see how forms can be configured.  I see the differences between
> indexSuccess.php, _list.php and _form.php.  But is there an easy way
> to enable display of actual names insted of IDs w/o doing the custom
> coding?
> 
> Thank you in advance
> 
> Dmitry
> 

-- 
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 [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-users?hl=en

Reply via email to