python bindings and lost business data
Geert Janssens
janssens-geert at telenet.be
Wed Jun 9 11:39:41 EDT 2010
On Wednesday 9 June 2010, Mark Jenkins wrote:
> > On Wednesday 9 June 2010, Mike Evans wrote:
> >> However the
> >> business objects do not seem to be loaded/saved so when session.save()
> >> is called all the business data, customers etc., are lost. It doesn't
> >> matter if I use the mysql or xml backend. Any thoughts?
>
> I was actually working on this yesterday after the other patches.
> Continuing today.
>
> I'm pretty sure the folks who responded a few months back had it right,
> inadequate modules are being loaded or inadequate gnucash init functions
> are being called in order to allow either the load or save of business
> objects to work correctly.
>
> Geert Janssens wrote:
> > This is because noone created python bindings for the business objects so
> > far. As a result, the python bindings will ignore anything business
> > related,
>
> Lack of bindings is different from lack of adequate data load/save. The
> existence of bindings or not determines what parts of the api are
> accessible to the end-user via python; the amount of exposure doesn't
> change what happens when the GnuCash C code takes over during load/save.
> (which is where we think data is lost due to inadequate initialization
> by the modules)
>
> This situation isn't a matter of lack of API exposure; that would be a
> feature request -- this business data loss stuff is a bindings bug. I
> would of noticed it sooner if a bug report had been filed against
> component Python Bindings.
>
Thanks for clearing that up. My knowledge of the python bindings is about 0. I
just rephrased what I had seen passing on the list a while back. My wordings
were obviously less than accurate...
>
> There is actually already committed a first start on the bindings side.
> You can do
>
> >>> from gnucash.gnucash_business import Customer, Employee, Vendor, \
>
> Address, BillTerm
>
> and everything low level from guid.h, gnc-lot.h, gncCustomer.h,
> gncEmployee.h, gncVendor.h, gncAddress.h, gncBillTerm.h is available via
> from gnucash.gnucash_core_c import whatever
> or
> from gnucash._gnucash_core_c import whatever
>
> and can play with those a bit at runtime.
>
> Back to bug killing.
>
>
> Mark
>
More information about the gnucash-devel
mailing list