On Tue, Feb 5, 2013 at 10:43 PM, Alessandro Molina <
[email protected]> wrote:

> 1.) I would like to add an extra computed field to the table view of the
>> items (items has many attempts), the number of attempts. As I see, it
>> should be possible:
>>
>
>      __table_options__ = {
>         '__add_fields__':{'more':None},
>         'more': lambda filler, row:'hi'
>     }
>
> __add_fields__ tell that there is the field and that no particular widget
> has to be used to display it and the 'more' entry tells to the table what
> is the value for more
>
> Huh, weird syntax, I guess I would not have found it on my own.

>
>
>> 2.) As moschlar pointed out, if I declare a _name property for a model,
>> it will be used in a one-to-many relation. (they kindly posted
>> https://gist.github.com/moschlar/4714146 for me) But could it be used in
>> the other direction? Eg. item has many attempts. Attempt has a _name
>> property. But on the page http://127.0.0.1:8080/items/1/edit Attempts
>> are just ids.
>>
>
> Not sure about this, try to playing with dropdown_field_names on both
> sides of the relation (http://blog.axant.it/archives/457 here an example).
> It's been some time since I had to do something like so I don't have the
> answer ready right now :D
>

Bad luck with it. As long as  dropdown_field_names points to a declared
field in the model, it is ok, but when I change it to a property getter, it
stops working.



+-[ Gergely Kontra <[email protected]> ]------------------+
|                                                           |
| Mobile:(+36 20)356 9656                                   |
|                                                           |
+- "Olyan lángész vagyok, hogy poroltóval kellene járnom!" -+

-- 
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 http://groups.google.com/group/turbogears?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to