[google-appengine] Re: prepopulate form fields according to http get parameters

2009-02-10 Thread niklasr

I agree and plan to keep labels and values for options (alternating
list or dictionary) and optionValueFromQuery getparameter tag we get
from library or make. (EL tags can do it so django tags can.)
{{currentOptionLabel}}

Thank you
Niklas
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: prepopulate form fields according to http get parameters

2009-02-09 Thread Nash-t

I think you have already solved half this problem!

On Feb 8, 4:37 am, niklasr  wrote:
> On Feb 8, 10:11 am, Alexander Kojevnikov 
> wrote:
>
> > On Feb 8, 6:56 pm, niklasr  wrote:
>
> > > I'm looking for template tags or similar that according to http get
> > > request parameters set the corresponding html form fields. To achieve
> > > the selection of an html option and populate a textfield according to
> > > the http request parameters where http get with two parameters should
> > > prepopulate a textfield and the option selected in my html form /main?
> > > q=foo&w=2 should set the textfield to 'foo' and the select option 2 to
> > > state selected. I saw no template tag that directly tests or handles a
> > > http get parameter but there probably is, for a more direct and
> > > favorable way than passing the request parameters and testing option
> > > by option
> > >  
> > > ...
> > > {% ifequal w "2" %}
> > > Apples
> > > {% else %}
> > > Apples
> > >  {% endifequal %}
> > > ...
> > > Thank you
> > > Niklas
>
> > This is normally done using Django 
> > forms:http://docs.djangoproject.com/en/dev/topics/forms/
>
> Many thanks. I understand
> google.appengine.ext.db.djangoforms.ModelForm or django.forms.Form or
> just loop the options and set the selected, if only there was an
> optionFromQuery value:
> {% for currentOption in allOptions %}  value="{currentOption}" {% ifequal currentOption optionFromQuery %}
> selected{% endifequal %}>{currentOption}{% endfor %}
> Best regards
> Niklas
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: prepopulate form fields according to http get parameters

2009-02-08 Thread niklasr



On Feb 8, 10:11 am, Alexander Kojevnikov 
wrote:
> On Feb 8, 6:56 pm, niklasr  wrote:
>
>
>
> > I'm looking for template tags or similar that according to http get
> > request parameters set the corresponding html form fields. To achieve
> > the selection of an html option and populate a textfield according to
> > the http request parameters where http get with two parameters should
> > prepopulate a textfield and the option selected in my html form /main?
> > q=foo&w=2 should set the textfield to 'foo' and the select option 2 to
> > state selected. I saw no template tag that directly tests or handles a
> > http get parameter but there probably is, for a more direct and
> > favorable way than passing the request parameters and testing option
> > by option
> >  
> > ...
> > {% ifequal w "2" %}
> > Apples
> > {% else %}
> > Apples
> >  {% endifequal %}
> > ...
> > Thank you
> > Niklas
>
> This is normally done using Django 
> forms:http://docs.djangoproject.com/en/dev/topics/forms/
Many thanks. I understand
google.appengine.ext.db.djangoforms.ModelForm or django.forms.Form or
just loop the options and set the selected, if only there was an
optionFromQuery value:
{% for currentOption in allOptions %} {currentOption}{% endfor %}
Best regards
Niklas
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: prepopulate form fields according to http get parameters

2009-02-08 Thread Alexander Kojevnikov

On Feb 8, 6:56 pm, niklasr  wrote:
> I'm looking for template tags or similar that according to http get
> request parameters set the corresponding html form fields. To achieve
> the selection of an html option and populate a textfield according to
> the http request parameters where http get with two parameters should
> prepopulate a textfield and the option selected in my html form /main?
> q=foo&w=2 should set the textfield to 'foo' and the select option 2 to
> state selected. I saw no template tag that directly tests or handles a
> http get parameter but there probably is, for a more direct and
> favorable way than passing the request parameters and testing option
> by option
>  
> ...
> {% ifequal w "2" %}
> Apples
> {% else %}
> Apples
>  {% endifequal %}
> ...
> Thank you
> Niklas

This is normally done using Django forms:
http://docs.djangoproject.com/en/dev/topics/forms/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---