Python bindings: patch, documentation, examples

John Ralls jralls at
Tue Jan 14 11:22:50 EST 2014

On Jan 14, 2014, at 8:05 AM, David Osguthorpe <david.osguthorpe at> wrote:

> On Mon, Jan 13, 2014 at 03:59:29PM -0800, John Ralls wrote:
>> Please remember to copy the list on all replies. Use “reply all” or, if your mailer supports it, “reply list”.
> sorry - on some lists the list email is first - others not - remembering which one is which
> is a problem
>> You should use the Query interface to find objects. If there are any “foo_find_by_bar” functions in the API now, they’ll be ripped out in the rewrite. In order to get to multiuser we’ll only be instantiating objects on demand, ideally only to edit unless it turns out to be easier to instantiate for viewing.
> what is the Query interface - is that the libqof functions??
> Is there an example which shows how this is done  - I dont remember seeing any query functions
> for budgets in gnc-budget.c

The current interface is QOFQuery. All of the persistent objects in Engine implement the QOFObject interface which QOFQuery uses, so it's available for Budgets regardless of whether the gnc-budget code uses it. You must *not* look at code in src/engine for examples of what to do: That code is private and is going to change a *lot* in the coming dev cycle. Look instead at src/report. 

I can't be certain that we'll get to replacing QOFQuery in this cycle, but we will eventually replace it with SQL when we migrate to using the database as a database instead of a mere persistence store, so be sure to abstract your query code so that it can be easily replaced.

John Ralls

More information about the gnucash-devel mailing list