Keyword argument 'from'; invalid syntax

K

Kai Kuehne

Hi list!
I'm using pygmalion (magnolia api access lib) and want to
use the following method that it is offering:

magnolia.bookmarks_find(person='user', from=some_datetime)

As you may noticed, from is a keyword argument and so I
get the following error message from python:

File "<ipython console>", line 1
magnolia.bookmarks_find(person='user', from=some_datetime)
^
<type 'exceptions.SyntaxError'>: invalid syntax

I have tried to prepare a dict and then passing it to the
method afterwards:<type 'exceptions.TypeError'>: bookmarks_find() takes exactly 1
argument (2 given)

I'm out of ideas so help is greatly appreciated!
Thanks
Kai
 
P

Paul Rubin

Kai Kuehne said:
<type 'exceptions.TypeError'>: bookmarks_find() takes exactly 1
argument (2 given)

I'm out of ideas so help is greatly appreciated!

Try
magnolia.bookmarks_find(**d)
 
S

Steven D'Aprano

I have tried to prepare a dict and then passing it to the
method afterwards:
<type 'exceptions.TypeError'>: bookmarks_find() takes exactly 1
argument (2 given)

I'm out of ideas so help is greatly appreciated!

Try this:

magnolia.bookmarks_find(**d)

although I suspect that will probably raise an exception as well. Judging
by the error message, it looks like bookmarks_find() takes only a single
argument, which I imagine would be the "self" instance automatically
provided at runtime.
 
S

Stargaming

Try this:

magnolia.bookmarks_find(**d)

although I suspect that will probably raise an exception as well.
Judging by the error message, it looks like bookmarks_find() takes only
a single argument, which I imagine would be the "self" instance
automatically provided at runtime.

Could be bookmarks_find(person, **other), unpacking other manually.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top