Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
SingleSelectField options Query.filter user_id
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
RyanWilson  
View profile  
 More options Nov 2 2012, 10:39 am
From: RyanWilson <ryanpaulwil...@gmail.com>
Date: Fri, 2 Nov 2012 07:39:13 -0700 (PDT)
Local: Fri, Nov 2 2012 10:39 am
Subject: SingleSelectField options Query.filter user_id

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 must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Moritz Schlarb  
View profile  
 More options Nov 2 2012, 5:01 pm
From: Moritz Schlarb <m...@moritz-schlarb.de>
Date: Fri, 2 Nov 2012 14:01:10 -0700 (PDT)
Local: Fri, Nov 2 2012 5:01 pm
Subject: Re: SingleSelectField options Query.filter user_id

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/submissi...

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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
RyanWilson  
View profile  
 More options Nov 3 2012, 1:01 am
From: RyanWilson <ryanpaulwil...@gmail.com>
Date: Fri, 2 Nov 2012 22:01:32 -0700 (PDT)
Local: Sat, Nov 3 2012 1:01 am
Subject: Re: SingleSelectField options Query.filter user_id

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
RyanWilson  
View profile  
 More options Nov 5 2012, 10:05 am
From: RyanWilson <ryanpaulwil...@gmail.com>
Date: Mon, 5 Nov 2012 07:05:30 -0800 (PST)
Local: Mon, Nov 5 2012 10:05 am
Subject: Re: SingleSelectField options Query.filter user_id

Working sweet.  Thanks!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »