Hello

I've created two tables in an m:n relationship: 

Activity (id, name)
EventDates (id, date)

and linked these two using a sqlalchemy `relation`, mapping EventDates as 
`event_dates` to Activity.

I want to create Activities that can take on one or more EventDates.
Using the admin (and also a form generated with a `CrudRestController` as 
seen here 
<http://turbogears.readthedocs.io/en/latest/cookbook/Crud/index.html#custom-crudrestcontroller>),
 
the generated Multi-Select widget in the new-Activity Form just displays me 
the primary key of the EventDate entries. I'd rather have it display the 
date of the EventDate entries. 

I've inherited this application and am not really familiar with Turbogears. 
Looking at some already existing models that are tied in with 
`TGAuthMetadata` i can see in the Admin that there is basically the same 
thing going on with User <-> Group <-> Permissions, and in these forms the 
user_name, group_name or permission_name get displayed in the Multi-Select 
and I cannot figure out how that has been achieved.

So basically if I have this:

class ActivityAddForm(AddRecordForm):
 __model__ = Activity
 __omit_fields__ = ['id']
 event_dates = ??? # this has an m:n relation to EventDate


How do i get the resulting Multi-Select to render something different than 
the primary key of EventDate? Is it derived from the model? Is it 
configured somewhere?

I've been messing around with `PropertyMultipleSelectField`, but could not 
figure out how to properly configure it to pass it as `event_dates`.

Thanks for your time.

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.

Reply via email to