Coder Social home page Coder Social logo

Comments (2)

maxcutler avatar maxcutler commented on July 17, 2024

Sorry about that, the 2.0 release is missing the terms_names configuration. I hope to release an update this weekend that fixes this, but until then you'll have to explicitly use WordPressTerm objects in the post.terms list.

from python-wordpress-xmlrpc.

level09 avatar level09 commented on July 17, 2024

Thanks Max,

I'm trying to do it the way you suggested but still getting an error :

Here is the code:

from wordpress_xmlrpc import *
from wordpress_xmlrpc.methods.taxonomies import *
from wordpress_xmlrpc.methods.posts import *
from wordpress_xmlrpc.methods.users import *
from wordpress_xmlrpc.methods import *

client = Client('http://wordpress.local/xmlrpc.php','admin','pass')

post = WordPressPost()
post.title = 'Post with new tags'
post.content = '...'

tag = WordPressTerm()
tag.taxonomies = 'post_tag'
tag.name = 'My New Tag'
tag.id = client.call(taxonomies.NewTerm(tag))

Here is the error generated:

Traceback (most recent call last):
  File "/Users/nidal/playground/python/pywp/test.py", line 16, in <module>
    tag.id = client.call(taxonomies.NewTerm(tag))
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wordpress_xmlrpc/base.py", line 38, in call
    e = sys.exc_info()[1]
NameError: global name 'sys' is not defined

Process finished with exit code 1

from python-wordpress-xmlrpc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.