i've written something similar to Dajax..
but i don't think that's a good solution..
and i'll not use it in my new project..

it goes the opposite of django philosophy..to design url explicitly..
url should be well mantained..
..and can be used as an api..as similar as possible
i thought..

On 5月9日, 上午2时22分, Ogi Vranesic <o...@redcor.ch> wrote:
> Hallo
>
> You can use Dajax(ice) to solve your issue.
> First Dajax and Dajaxice must be installed.
> In your select box for countries add event 'onchange' i.e.:
> onchange="Dajaxice.ajax.getCitiesByCountry('Dajax.process', {'name':this.name,
> 'value':this.value})">
> According to this example you must have the file ajax.py and the function
> getCitiesByCountry must be registered in settings.py like:
> DAJAXICE_FUNCTIONS = (
>         'ajax.getCitiesByCountry',
> )
>
> Afterwards define the function getCitiesByCountry in ajax module
> where you can generate options for cities using python and replace them
> automatically in html.
>
> If something is not clear google for Dajax, Dajaxice, dajax.json()
>
> Greetings
> Ogi
>
> On Sonntag 08 Mai 2011 06:46:54 pm you wrote:
>
>
>
>
>
>
>
> > but i dont know about jquery or ajax, can i get any example from any
> > site , can u provide any link which has such code written
>
> > On May 7, 12:10 pm, Shawn Milochik <sh...@milochik.com> wrote:
> > > You'll need to write JavaScript.
>
> > > Specifically:
>
> > >      Write a function that uses AJAX to pass the state to a Django view
> > > and receive the city list, then populate the city drop-down.
>
> > >      Bind that function to the change event of your state drop-down box.
>
> > > This isn't a Django question, though. If you have trouble doing that try
> > > a JavaScript mailing list.
>
> > > I recommend using jQuery's .ajax() function for this.
>
> > > Shawn

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

Reply via email to