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:
>>> d = {'person': 'user', 'from': vorgestern}
>>> magnolia.bookmarks_find(d)
<type 'exceptions.TypeError'>: bookmarks_find() takes exactly 1
argument (2 given)
I'm out of ideas so help is greatly appreciated!
Thanks
Kai
Try
magnolia.bookmarks_find(**d)
> I have tried to prepare a dict and then passing it to the
> method afterwards:
>>>> d = {'person': 'user', 'from': vorgestern}
>>>> magnolia.bookmarks_find(d)
> <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.
--
Steven.
On 7/26/07, Steven D'Aprano <st...@remove.this.cybersource.com.au> wrote:
> On Thu, 26 Jul 2007 03:33:20 +0200, Kai Kuehne wrote:
> Try this:
>
> magnolia.bookmarks_find(**d)
This works perfectly, thank you guys.
Kai
Could be bookmarks_find(person, **other), unpacking other manually.