AJAX and CherryPy: Most of the application becomes Javascript rather than python?

View: New views
5 Messages — Rating Filter:   Alert me  

AJAX and CherryPy: Most of the application becomes Javascript rather than python?

by brahmaforces :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi All,

In creating my web system I wanted to create a string of Select Boxes
where the selection in one results in the appearance of the 2nd with
values that depend on the Selection in the 1st and this severaltimes
over. In general one could use the postback method or the AJAX method.
The post back method is obsolete from an interface point of view. This
leaves the AJAX method.

My issue is this. If AJAX functionality is the way to go on the client
side, then most of the coding is done on the client side in Javascript
and very little coding is required on the server side in Python. And
the whole point was/is to code in the beloved Python!

So what is the approach that you all are taking. If one accepts AJAX
as the way to create non refresh convenient widgets and functionality,
does that mean that we can only code in python for the left over
stuff, and most of the programming is consumated in Javascript?

If this is the case, where does that leave cherrypy, because CP is
primarily to allow programmers to code for the web in python. The AJAX
model makes most of the code client side.

I googled and searched the groups but found no discussion on this. I
find that if I want to make things happen AJAXLY ie non refersh, then
there is little server side code. Is this true?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users@...
To unsubscribe from this group, send email to cherrypy-users-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: AJAX and CherryPy: Most of the application becomes Javascript rather than python?

by crimsonPhantom :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


hey brahmaforces,

it all depends on the amount of the things you do on the server side I
guess. I'm currently coding this
huge client/inventory/rental system with CherryPy using bits of
XmlHttpRequest here and there. I'd say the amount of code
for the user interface is almost as lengthy as the server side one.
I tend to use javascript libraries such as JQuery or ExtJs to ease DOM
manipulation so it's just a matter of
linking your stuff together instead of rewriting your own javascript
for your interface. You just need to choose carefully where you should
add javascript.

let's say I have a rental form that I need to fill with a client, some
dates and items to rent.

The user wants to add a new rental so it goes to the rental adding
form. There's an autocomplete ajax call to get the client once the
user begins typing a name/phone number.
There's also a handy javascript calendar to select the rental starting
and ending dates. Here, it's just a matter of choosing the jquery
calendar widget so there ain't too much coding to do for you.
Adding items also uses some autcomplete as the user types the item
number. the autocomplete then fills up the rest of the item's
information. And saving the rental uses a simple POST.

If the user wants to edit that particular rental, he goes into the
rental modification form (which is the same as the rental adding one
with a particular flag). Once there, I don't use javascript to fill in
the information that was entered in the 1st step. I give all those
informations to the form template and fill everything up adding the
client, the dates and a loop to add every items. all done by Python
and Cheetah Template. Once everything is added, I sprinkle the
necessary javascript on the inputs/select boxes/check boxes. That part
is really easy with JQuery.

There ya go. I hope my example has cleared your vision on the matter a
bit. In short, Python handles the data and whatever-template-language-
that-spits-HTML/CSS/Javascript does the rest.
There's plenty of Python in there!

Bernard

On Jun 5, 5:21 am, brahmaforces <brahmafor...@...> wrote:

> Hi All,
>
> In creating my web system I wanted to create a string of Select Boxes
> where the selection in one results in the appearance of the 2nd with
> values that depend on the Selection in the 1st and this severaltimes
> over. In general one could use the postback method or the AJAX method.
> The post back method is obsolete from an interface point of view. This
> leaves the AJAX method.
>
> My issue is this. If AJAX functionality is the way to go on the client
> side, then most of the coding is done on the client side in Javascript
> and very little coding is required on the server side in Python. And
> the whole point was/is to code in the beloved Python!
>
> So what is the approach that you all are taking. If one accepts AJAX
> as the way to create non refresh convenient widgets and functionality,
> does that mean that we can only code in python for the left over
> stuff, and most of the programming is consumated in Javascript?
>
> If this is the case, where does that leave cherrypy, because CP is
> primarily to allow programmers to code for the web in python. The AJAX
> model makes most of the code client side.
>
> I googled and searched the groups but found no discussion on this. I
> find that if I want to make things happen AJAXLY ie non refersh, then
> there is little server side code. Is this true?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users@...
To unsubscribe from this group, send email to cherrypy-users-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: AJAX and CherryPy: Most of the application becomes Javascript rather than python?

by brahmaforces :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Ill check out Jquery,  any other recommendations for javascript object
libraries that work well and dont have too much of a learning curve.
ie i dont want to waste my time learning another framework in too much
detail something that provides widgets and simple objects without
providing a large api?

On Jun 6, 6:10 pm, "bernard.chhun" <bernard.ch...@...> wrote:

> hey brahmaforces,
>
> it all depends on the amount of the things you do on the server side I
> guess. I'm currently coding this
> huge client/inventory/rental system with CherryPy using bits of
> XmlHttpRequest here and there. I'd say the amount of code
> for the user interface is almost as lengthy as the server side one.
> I tend to use javascript libraries such as JQuery or ExtJs to ease DOM
> manipulation so it's just a matter of
> linking your stuff together instead of rewriting your own javascript
> for your interface. You just need to choose carefully where you should
> add javascript.
>
> let's say I have a rental form that I need to fill with a client, some
> dates and items to rent.
>
> The user wants to add a new rental so it goes to the rental adding
> form. There's an autocomplete ajax call to get the client once the
> user begins typing a name/phone number.
> There's also a handy javascript calendar to select the rental starting
> and ending dates. Here, it's just a matter of choosing the jquery
> calendar widget so there ain't too much coding to do for you.
> Adding items also uses some autcomplete as the user types the item
> number. the autocomplete then fills up the rest of the item's
> information. And saving the rental uses a simple POST.
>
> If the user wants to edit that particular rental, he goes into the
> rental modification form (which is the same as the rental adding one
> with a particular flag). Once there, I don't use javascript to fill in
> the information that was entered in the 1st step. I give all those
> informations to the form template and fill everything up adding the
> client, the dates and a loop to add every items. all done by Python
> and Cheetah Template. Once everything is added, I sprinkle the
> necessary javascript on the inputs/select boxes/check boxes. That part
> is really easy with JQuery.
>
> There ya go. I hope my example has cleared your vision on the matter a
> bit. In short, Python handles the data and whatever-template-language-
> that-spits-HTML/CSS/Javascript does the rest.
> There's plenty of Python in there!
>
> Bernard
>
> On Jun 5, 5:21 am, brahmaforces <brahmafor...@...> wrote:
>
> > Hi All,
>
> > In creating my web system I wanted to create a string of Select Boxes
> > where the selection in one results in the appearance of the 2nd with
> > values that depend on the Selection in the 1st and this severaltimes
> > over. In general one could use the postback method or the AJAX method.
> > The post back method is obsolete from an interface point of view. This
> > leaves the AJAX method.
>
> > My issue is this. If AJAX functionality is the way to go on the client
> > side, then most of the coding is done on the client side in Javascript
> > and very little coding is required on the server side in Python. And
> > the whole point was/is to code in the beloved Python!
>
> > So what is the approach that you all are taking. If one accepts AJAX
> > as the way to create non refresh convenient widgets and functionality,
> > does that mean that we can only code in python for the left over
> > stuff, and most of the programming is consumated in Javascript?
>
> > If this is the case, where does that leave cherrypy, because CP is
> > primarily to allow programmers to code for the web in python. The AJAX
> > model makes most of the code client side.
>
> > I googled and searched the groups but found no discussion on this. I
> > find that if I want to make things happen AJAXLY ie non refersh, then
> > there is little server side code. Is this true?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users@...
To unsubscribe from this group, send email to cherrypy-users-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: AJAX and CherryPy: Most of the application becomes Javascript rather than python?

by crimsonPhantom :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


mooFX & JQuery are both great choices man :)

I have this little preference over JQuery as I've worked more often
with it.

On 7 juin, 01:39, brahmaforces <brahmafor...@...> wrote:

> Ill check out Jquery,  any other recommendations for javascript object
> libraries that work well and dont have too much of a learning curve.
> ie i dont want to waste my time learning another framework in too much
> detail something that provides widgets and simple objects without
> providing a large api?
>
> On Jun 6, 6:10 pm, "bernard.chhun" <bernard.ch...@...> wrote:
>
> > hey brahmaforces,
>
> > it all depends on the amount of the things you do on the server side I
> > guess. I'm currently coding this
> > huge client/inventory/rental system with CherryPy using bits of
> > XmlHttpRequest here and there. I'd say the amount of code
> > for the user interface is almost as lengthy as the server side one.
> > I tend to use javascript libraries such as JQuery or ExtJs to ease DOM
> > manipulation so it's just a matter of
> > linking your stuff together instead of rewriting your own javascript
> > for your interface. You just need to choose carefully where you should
> > add javascript.
>
> > let's say I have a rental form that I need to fill with a client, some
> > dates and items to rent.
>
> > The user wants to add a new rental so it goes to the rental adding
> > form. There's an autocomplete ajax call to get the client once the
> > user begins typing a name/phone number.
> > There's also a handy javascript calendar to select the rental starting
> > and ending dates. Here, it's just a matter of choosing the jquery
> > calendar widget so there ain't too much coding to do for you.
> > Adding items also uses some autcomplete as the user types the item
> > number. the autocomplete then fills up the rest of the item's
> > information. And saving the rental uses a simple POST.
>
> > If the user wants to edit that particular rental, he goes into the
> > rental modification form (which is the same as the rental adding one
> > with a particular flag). Once there, I don't use javascript to fill in
> > the information that was entered in the 1st step. I give all those
> > informations to the form template and fill everything up adding the
> > client, the dates and a loop to add every items. all done by Python
> > and Cheetah Template. Once everything is added, I sprinkle the
> > necessary javascript on the inputs/select boxes/check boxes. That part
> > is really easy with JQuery.
>
> > There ya go. I hope my example has cleared your vision on the matter a
> > bit. In short, Python handles the data and whatever-template-language-
> > that-spits-HTML/CSS/Javascript does the rest.
> > There's plenty of Python in there!
>
> > Bernard
>
> > On Jun 5, 5:21 am, brahmaforces <brahmafor...@...> wrote:
>
> > > Hi All,
>
> > > In creating my web system I wanted to create a string of Select Boxes
> > > where the selection in one results in the appearance of the 2nd with
> > > values that depend on the Selection in the 1st and this severaltimes
> > > over. In general one could use the postback method or the AJAX method.
> > > The post back method is obsolete from an interface point of view. This
> > > leaves the AJAX method.
>
> > > My issue is this. If AJAX functionality is the way to go on the client
> > > side, then most of the coding is done on the client side in Javascript
> > > and very little coding is required on the server side in Python. And
> > > the whole point was/is to code in the beloved Python!
>
> > > So what is the approach that you all are taking. If one accepts AJAX
> > > as the way to create non refresh convenient widgets and functionality,
> > > does that mean that we can only code in python for the left over
> > > stuff, and most of the programming is consumated in Javascript?
>
> > > If this is the case, where does that leave cherrypy, because CP is
> > > primarily to allow programmers to code for the web in python. The AJAX
> > > model makes most of the code client side.
>
> > > I googled and searched the groups but found no discussion on this. I
> > > find that if I want to make things happen AJAXLY ie non refersh, then
> > > there is little server side code. Is this true?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users@...
To unsubscribe from this group, send email to cherrypy-users-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: AJAX and CherryPy: Most of the application becomes Javascript rather than python?

by brahmaforces :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks bro...will add these to my list of explorations to tweak the perfect development environment, which thus far includes cherrypy and  Mako...

On Sun, Jun 8, 2008 at 3:02 AM, bernard.chhun <bernard.chhun@...> wrote:

mooFX & JQuery are both great choices man :)

I have this little preference over JQuery as I've worked more often
with it.

On 7 juin, 01:39, brahmaforces <brahmafor...@...> wrote:
> Ill check out Jquery,  any other recommendations for javascript object
> libraries that work well and dont have too much of a learning curve.
> ie i dont want to waste my time learning another framework in too much
> detail something that provides widgets and simple objects without
> providing a large api?
>
> On Jun 6, 6:10 pm, "bernard.chhun" <bernard.ch...@...> wrote:
>
> > hey brahmaforces,
>
> > it all depends on the amount of the things you do on the server side I
> > guess. I'm currently coding this
> > huge client/inventory/rental system with CherryPy using bits of
> > XmlHttpRequest here and there. I'd say the amount of code
> > for the user interface is almost as lengthy as the server side one.
> > I tend to use javascript libraries such as JQuery or ExtJs to ease DOM
> > manipulation so it's just a matter of
> > linking your stuff together instead of rewriting your own javascript
> > for your interface. You just need to choose carefully where you should
> > add javascript.
>
> > let's say I have a rental form that I need to fill with a client, some
> > dates and items to rent.
>
> > The user wants to add a new rental so it goes to the rental adding
> > form. There's an autocomplete ajax call to get the client once the
> > user begins typing a name/phone number.
> > There's also a handy javascript calendar to select the rental starting
> > and ending dates. Here, it's just a matter of choosing the jquery
> > calendar widget so there ain't too much coding to do for you.
> > Adding items also uses some autcomplete as the user types the item
> > number. the autocomplete then fills up the rest of the item's
> > information. And saving the rental uses a simple POST.
>
> > If the user wants to edit that particular rental, he goes into the
> > rental modification form (which is the same as the rental adding one
> > with a particular flag). Once there, I don't use javascript to fill in
> > the information that was entered in the 1st step. I give all those
> > informations to the form template and fill everything up adding the
> > client, the dates and a loop to add every items. all done by Python
> > and Cheetah Template. Once everything is added, I sprinkle the
> > necessary javascript on the inputs/select boxes/check boxes. That part
> > is really easy with JQuery.
>
> > There ya go. I hope my example has cleared your vision on the matter a
> > bit. In short, Python handles the data and whatever-template-language-
> > that-spits-HTML/CSS/Javascript does the rest.
> > There's plenty of Python in there!
>
> > Bernard
>
> > On Jun 5, 5:21 am, brahmaforces <brahmafor...@...> wrote:
>
> > > Hi All,
>
> > > In creating my web system I wanted to create a string of Select Boxes
> > > where the selection in one results in the appearance of the 2nd with
> > > values that depend on the Selection in the 1st and this severaltimes
> > > over. In general one could use the postback method or the AJAX method.
> > > The post back method is obsolete from an interface point of view. This
> > > leaves the AJAX method.
>
> > > My issue is this. If AJAX functionality is the way to go on the client
> > > side, then most of the coding is done on the client side in Javascript
> > > and very little coding is required on the server side in Python. And
> > > the whole point was/is to code in the beloved Python!
>
> > > So what is the approach that you all are taking. If one accepts AJAX
> > > as the way to create non refresh convenient widgets and functionality,
> > > does that mean that we can only code in python for the left over
> > > stuff, and most of the programming is consumated in Javascript?
>
> > > If this is the case, where does that leave cherrypy, because CP is
> > > primarily to allow programmers to code for the web in python. The AJAX
> > > model makes most of the code client side.
>
> > > I googled and searched the groups but found no discussion on this. I
> > > find that if I want to make things happen AJAXLY ie non refersh, then
> > > there is little server side code. Is this true?




--
Best regards,
arjuna
http://www.brahmaforces.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users@...
To unsubscribe from this group, send email to cherrypy-users-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---

LightInTheBox - Buy quality products at wholesale price