Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 6d09f1b646
Fetching contributors…

Cannot retrieve contributors at this time

38 lines (24 sloc) 0.885 kb
from devapp.ptahclient import PtahClient
server = PtahClient('http://localhost:8080/__rest__/', 'admin', '12345')
if not server.login():
print server.message
else:
print 'success'
print server.authtkn
cms = server.applications['']
print cms, cms.__type__
pageType = server.types['page']
print pageType, pageType.title
for field in pageType.fieldset:
print field
content = cms.create(pageType, 'test-page.html',
title = 'Test page',
description = 'Description',
text = '<h2>Page from rest</h2>')
content.update(title = 'Test page modified',
text = '<h2>Page from rest</h2> <br /> Modified')
fileType = server.types['file']
cms.create(fileType, 'python-logo.gif',
title = 'Python logo',
description = '',
blobref = open('python-logo.gif', 'rb'))
Jump to Line
Something went wrong with that request. Please try again.