As a convenience for my project, I’ve patched the gviz_api python
module to allow partially specified column orderings.  Not sure if
this would help anyone else or if there is a better way to solve this
in python, but here is the diff:
562a563,568
>     if len(columns_order) < len(self.__columns):
>       columns_order = list(columns_order)
>       partial_order = columns_order[:]
>       for col in self.__columns:
>         if col["id"] not in partial_order:
>           columns_order.append(col["id"])
631a638,643
>     if len(columns_order) < len(self.__columns):
>       columns_order = list(columns_order)
>       partial_order = columns_order[:]
>       for col in self.__columns:
>         if col["id"] not in partial_order:
>           columns_order.append(col["id"])

There is one issue -- if specifying only one column the columns_order
parameter must be ensured to be a tuple or a list for the iteration to
work correctly so both of the following are possible e.g.
return data_table.ToJSonResponse(columns_order=("date",),order_by=
("date","asc"),req_id=id)
return data_table.ToJSonResponse(columns_order=(["date"]),order_by=
("date","asc"),req_id=id)

Note the additional comma in the tuple version and the square brackets
in the list version.

--Craig
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to