addExtensionElements?

0 views
Skip to first unread message

h...@mikehowarth.co.uk

unread,
Aug 12, 2008, 6:31:43 AM8/12/08
to GData Python Client Library Contributors
Hi

I was wondering if someone can help me.

I'm wanting to add a publishing_priority to my Google Base feed.

From reading the docs I need to add the following:

<entry xmlns:app='http://purl.org/atom/app#'
xmlns:gm='http://base.google.com/ns-metadata/1.0'>
...
<app:control>
<gm:publishing_priority>high</gm:publishing_priority>
</app:control>
</entry>

From a bit of guesswork I'm guessing I need to acheive this using the
addExtensionElements object. Can someone provide me with an example of
how this *actually* works.

Currently I've been adding the entire xml message in, but I'm not
getting very far.

Any help would be greatly appreciated!

Jeff S

unread,
Aug 12, 2008, 1:27:26 PM8/12/08
to GData Python Client Library Contributors
Hello Mike,

I think the following should fit your needs. I'm assuming that you
already have an object named entry.

extension = atom.ExtensionElement(namespace='http://base.google.com/ns-
metadata/1.0', tag='publishing_priority', text='high')
entry.extension_elements.append(extension)

You can check to make sure that the XML looks reasonable by calling
str(entry).

I had hoped that you would never need to use extension_elements, but
it would seem that the gdata.base module is missing a class for the
publishing_priority XML element which was added to the Google Base
API. Would you mind filing an issue to remind us to add this element?
http://code.google.com/p/gdata-python-client/issues/list

Thank you,

Jeff

On Aug 12, 3:31 am, "mikehowar...@googlemail.com"

Mike Howarth

unread,
Aug 12, 2008, 2:43:04 PM8/12/08
to gdata-python-client-...@googlegroups.com
Thanks for this Jeff. Having read through the code again this afternoon I'd
figured as much.

I've added an item to the list to jog your memory!


Hello Mike,

Thank you,

Jeff


Internal Virus Database is out-of-date.
Checked by AVG.
Version: 7.5.524 / Virus Database: 270.4.6/1538 - Release Date: 07/07/2008
07:40

Internal Virus Database is out-of-date.
Checked by AVG.
Version: 7.5.524 / Virus Database: 270.4.6/1538 - Release Date: 07/07/2008
07:40

Reply all
Reply to author
Forward
0 new messages