Thank you! I didn't know how to access what I pass into .display()
self.value should give me what I'm looking for. Best, Ryan On Friday, November 2, 2012 5:01:10 PM UTC-4, Moritz Schlarb wrote: > > I can just give you a vague answer, but there are methods on the widget, > which get called within the .display() call in your template. > If you supply values to the call to .display(), you can access those in > that functions and use it to display dynamic dropdown options. > > Here's an example: > > https://github.com/moschlar/SAUCE/blob/develop/sauce/widgets/submission.py#L35 > > self.value holds exactly what you pass in to the call to .display(). > > Am Freitag, 2. November 2012 15:39:13 UTC+1 schrieb RyanWilson: >> >> Hi, >> >> I'm populating the options of a SingleSelectField with a database query; >> however, I need to filter the query based on which user is logged in. In >> my controllers I simply call request.identity['repoze.who.userid'] to find >> the user with which I filter the data. When I try to make a call >> to request.identity from my a form, I get the following >> error: AttributeError: identity >> >> How can I find out which user is logged in from a form? If that's not >> possible in that context, how do I pass a variable from my controller to >> the form holding the user id? >> >> Thanks! >> >> Ryan >> > -- You received this message because you are subscribed to the Google Groups "TurboGears" group. To view this discussion on the web visit https://groups.google.com/d/msg/turbogears/-/YIYbNt3NEKYJ. 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/turbogears?hl=en.

