On Thu, Jul 19, 2012 at 09:04:33PM -0400, Michael Pedersen wrote:
>    I'm not sure what question you're actually asking here, but I'll try to
>    explain what I can.
OK, I'll give some examples. It could well be I'm just confused, but it
probably means others are too. TG (and TW) are both great, it is just a
bit hard to understand the documents.

http://turbogears.org/2.1/docs/main/ToscaWidgets/Cookbook/FlexiGrid.html
This is the style Rob also mentions. This tutorial uses tw1 not tw2 but
it seems to follow through. The FlexiGrid uses a json call back to the
server called fetch.  I'm a little confused why you would do a query
THEN place a limit about 5 lines down, doesn't this mean you fetch 100s
of database rows and then throw away all but 25 of them?
This documentation is deprecated in 2.2 with no replacement, I assume
because it is TW1 and not TW2.
Both the widget and the json method have the model in them. The widget
specifies what columns are seen and the method access the specific
model. This way seems the clearest to me.

http://www.toscawidgets.org/documentation/tw2.core/turbogears.html
About 3/4 down the page there is a section called "Getting Fancier"
This grid accesses its data through a url like
/tw2_controllers/db_jqgrid/ but to get it to work you have to muck
around with the app_config.py to make a new middleware.  It only
talks about TG2.1 and 2.0 Uses the SQLAjqGridWidget which filters the 
column and what model to query.

http://threebean.org/blog/2011/04/30/tutorial-melting-your-face-off-with-tw2-and-turbogears2-1/
Ralph Bean's tutorial.  This had a lot of those "I get it now" moments.
This creates a widget inherited from SQLAjqGridWidget that then calls 
a common url. But the method is two lines long. The widget specifies 
the model used.

For #2 and #3 I don't see how you can do things like filter from the
initial standpoint. The filters work with a user playnig with a grid but
for a page like /parent/42 I'd like to display a grid of all the children
of parent #42 and only show them no matter what the user clicks on the
grid.

They all work btw, I have test code that more or less does all three
methods; I'm just not sure what is the right one to use.

 - Craig
-- 
Craig Small VK2XLZ   http://enc.com.au/          csmall at : enc.com.au
Debian GNU/Linux     http://www.debian.org/      csmall at : debian.org
GPG fingerprint:     5D2F B320 B825 D939 04D2  0519 3938 F96B DF50 FEA5

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en.

Reply via email to