Re: [GNC] How To Get Job Object?

2022-08-10 Thread Robert Simmons
gnucash.Query() looks like the real winner of the swiss army knife function. Replacements for direct SQL queries. This one replaces SELECT max(id) FROM jobs def get_job_maxid(): query = gnucash.Query() query.search_for('gncJob') query.set_book(book) job_ids = list() for

Re: [GNC] How To Get Job Object?

2022-08-10 Thread john
And that's pretty much the way the GUI works too. BTW do you know about the Doxygen-generated docs for the C API? It's a bit patchy in parts, but there's a ton of useful info. You can build it yourself or use our nightly builds at https://code.gnucash.org/docs/MAINT. Regards, John Ralls > On

Re: [GNC] How To Get Job Object?

2022-08-10 Thread john
GUIDs belong to the parent class QofInstance, so you use qof_instance_get_guid(my_job) Regards, John Ralls > On Aug 10, 2022, at 5:42 PM, Robert Simmons wrote: > > I have created a number of Jobs. Now I want to associate an invoice with > one of the jobs. I can see there is a function

Re: [GNC] How To Get Job Object?

2022-08-10 Thread Robert Simmons
When I'm done with all this, I'm going to contribute new example scripts. The current documentation for the Python bindings is very excellent. It's some of the best documentation I've ever seen. It's a pleasure to use and saves a ton of time. Here is the only way that I can find of getting from

[GNC] How To Get Job Object?

2022-08-10 Thread Robert Simmons
I have created a number of Jobs. Now I want to associate an invoice with one of the jobs. I can see there is a function "book.JobLookup()" but the argument this takes is GncGUID. I don't know how to create this GUID object, and the only way I can see to get the GUID is to just do a SQL query