Hi AwaisMuzaffar,

1. To be able to call a python function via an ajax call you will have to make 
the function in your python module a callable view and then call the url that 
is assigned to the view in your js script.

2.  As for calling a view in $.post, are you using traversal or url_dispatch?  
Using either system would cause the urls to be slightly different.  The 
simplest route to take is using url dispatch since it would allow you to create 
a simple url like /aview/.

If you have any other questions please let me know.

Cheers,

RJ

On 2011-06-16, at 8:18 AM, AwaisMuzaffar wrote:

> 1- In my pyramid package directory, if I create a file called
> somefunction.py and I want to call this function using $.post, what
> URL would I specify to call this function.
> 
> and:
> 
> 2- And if I have a view function called aview created in views.py, can
> I call this function by simply referring the $.post URL as /aview/
> 
> (script files reside in the static folder)
> 
> Thanks.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "pylons-discuss" group.
> To post to this group, send email to pylons-discuss@googlegroups.com.
> To unsubscribe from this group, send email to 
> pylons-discuss+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/pylons-discuss?hl=en.
> 

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

Reply via email to