Is it reasonably easy easy to something like this with python?

  • Thread starter Bruno Desthuilliers
  • Start date
B

Bruno Desthuilliers

Gerardo Herzig a écrit :
The one who make that table sorteable is AJAX. Not php. The php part is
kind of trivial (so it would be `trivial' in python too). It just reads
some data and format it in an html table.

FWIW, Pylons have all sorts of javascript/ajax helpers (using
prototype.js).
 
W

walterbyrd

This is made with a php5 framework called qcodo.

http://examples.qcodo.com/examples/dynamic/inline_editing.php

With qcodo it's easy to make grids that are sortable and inline
editable. Qcodo grids work from the database - not an xml table or
array. Qcodo handles complex data relations, and fairly large
datadabes.

I like python better than php, but I don't know of any python tools to
create these sorts of grids.
 
G

Gerardo Herzig

walterbyrd said:
This is made with a php5 framework called qcodo.

http://examples.qcodo.com/examples/dynamic/inline_editing.php

With qcodo it's easy to make grids that are sortable and inline
editable. Qcodo grids work from the database - not an xml table or
array. Qcodo handles complex data relations, and fairly large
datadabes.

I like python better than php, but I don't know of any python tools to
create these sorts of grids.
The one who make that table sorteable is AJAX. Not php. The php part is
kind of trivial (so it would be `trivial' in python too). It just reads
some data and format it in an html table.

Cheers.
Gerardo
 
W

walterbyrd

walterbyrd wrote:
The one who make that table sorteable is AJAX. Not php. The php part is
kind of trivial (so it would be `trivial' in python too). It just reads
some data and format it in an html table.


Thank you, that is great to know. What if there were 1000 records, and
the table was paginated? I suppose, ajax would sort the front end, and
backend language, and database, would soft behind the scene, or
something?
 
G

Gerardo Herzig

walterbyrd said:
Thank you, that is great to know. What if there were 1000 records, and
the table was paginated? I suppose, ajax would sort the front end, and
backend language, and database, would soft behind the scene, or
something?
Im not an AJAX expert (not even close actually. In fact i just used it
once), but seems like you will have to reload all the page (all the
table at least). Because now is a different scenario. If the table is
paginated, it looks like you will send, say 50 results at one time, then
(when pressing 'next 50'), anhoter 50, and so on. So AJAX only will
have THOSE 50 for ordering. Another approach would be returning de
entire recordset, and implement all the 'next' and 'previous' links via
AJAX. And i dont think you will like to send the entire result. I dont.

What will i do (at least from WIK for now), is having a set of `hrefs'
(maybe with some nice arrows) in all of the table headers, to indicate
the desired order you want to get. And, if you have a column table named
'age', you will make those href like
'<a
href=showmethetable.py?columnorder=age&ordertype=asc><nice_arrow_graphic>'

then your cgi python script will take that mess after the ? sign, parse
it (via cgi module perhaps), and make a new query, with the 'order by
age asc' clause, wich are the 'arguments' in the url.

There is allways a lot of ways to do some stuff. I will check into de
AJAX list too!

Cheers.
Gerardo
 
B

Bruno Desthuilliers

walterbyrd a écrit :
Thank you, that is great to know. What if there were 1000 records, and
the table was paginated?
>
I suppose, ajax would sort the front end,

s/ajax/javascript/

You don't need ajax to sort a table, it's pure javascript dom
manipulation (and there are quite a lot of working, correctly written
and well-tested scripts doing so).

In your above use case (sortable, paginated, inline-editable grid), ajax
would be used to:
- retrieve XXX records from the back-end (either as an html fragment or
in json) via a GET request
- submit modifications (via a POST request)

All the rest is either usual javascript or usual (backend) web programming.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top