Here is a quick and dirty (by fully functional) sample of updating a listpage/listitem in Google Sites using the Data API.
#!/usr/bin/python import getpass import gdata.sites.client import gdata.sites.data USER = 'test@example.com' SITE = 'YOUR_SITE_NAME' DOMAIN = 'YOUR_DOMAIN' # or 'site' if you're not using a Google Apps domain. # Setup our client. client = gdata.sites.client.SitesClient(source='google-SitesListeItemUpdateTest', site=SITE, domain=DOMAIN) client.ClientLogin(USER, getpass.getpass(), client.source) client.ssl = True client.http_client.debug = False # Only fetch listpages. feed = client.GetContentFeed(uri=client.MakeContentFeedUri() + '?kind=listpage') # Work with first listpage we found. lp = feed.GetListPages()[0] print 'Listpage columns:' for col in lp.data.column: print 'index: %s, name: %s' % (col.index, col.name) # Query the listpage's listems and work with first row found. li = client.GetContentFeed(uri=lp.feed_link.href).entry[0] print 'Row contents:' for field in li.field: print 'index: %s, name: %s, value: %s' % (field.index, field.name, field.text) # Update the first fields/column's value. li.field[0].text = 'Someone else' entry = client.Update(li) # Update the listpage's column heading. #lp.data.column[0].name = 'New Heading' #entry2 = client.Update(lp)
8 comments:
This is great! Any chance you could include a way to add an entry on top of updating existing ones?
how do you add a new listitem?
Very good article, thank you for sharing the best tips.
-(:Please visit 2 my blog:)-
Awesome! Good job, keep posting few more like this.
Et voici la preuve photographique. Cette sneak peek [ci-dessus] illustre la stratgie d'tre abattu par l'oncle Karl lui-mme, et bien que nous tions secrtement cherche voir miss Dellal apportant ses battues cuirs noirs sur la campagne, shes regardant puissante dame comme porter un gilet blanc et arc dlicate dans leur cheveux tresss. Thunk Whoda ci.
Mais ne vous inquitez pas, le bord marque Alices continue tre en raison de tact pour saisines de eye-liner noir en plus d'une lvre rouge vif. Le modle est perch sur une table de toilette l'intrieur d'un appartement somptueux haussmannien, tout en prsentant un sac main gris matelass avec la collection Sac Hermès Mini Plume.
Nous sommes impatients d'en savoir vraiment ce blog Sac Hermès Shoulder Birkin.
Outlook 2010 provides you with a world-class experience to maintain your efficiency and keep in touch with personal and business networks. You can use download Outlook 2010, through a rich set of features and custom communication with one or more recipients.
SEO Services Dehradun : We are provide affordable seo,sem,smo,ppc services , web design services and web development services in dehradun india.
Girl Xinh | Hot Girl | Cute Girl | Sexy Girl | Hot Girl Asian
Hot Girl | Lexi Belle | Sexy Girl | Cute Girl | Hot Asian Girl | Leah Dizon | Hot Girl Asian | Girl Xinh
socks proxy | socks5 | proxy free |proxy list
Post a Comment