Re: Refreshing current record in a form (Feature request ?)
Ernesto Revilla <[email protected]> Mon, 12 Sep 2005 18:40:41 +0200
| Newsgroups | gmane.comp.db.rekall.devel |
|---|---|
| Message-ID | <[email protected]> |
--===============0869794744== Content-Type: multipart/alternative; boundary="----=_Part_3597_10431133.1126543241169" ------=_Part_3597_10431133.1126543241169 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Good evening, Putting these fields into a separate subblock could do it, although I think= =20 it's not a very nice solution, because it's making the design more=20 complicate. I would prefer to implement a refresh option which could be called from=20 Python. (MS-Access has this.) Do I have a way the mark a record as "dirty",= =20 i.e. modified, from Python? Do I have a way to force a "save record"=20 operation? This is because, the save record operation, does automatically= =20 re-read the record from the database. So all the infrastructure is present.= =20 Perhaps I would just need a python binding. (In this case, could you give m= e=20 some tips (filenames) where to look for it?) I would try to send a patch. Best regards, Erny 2005/9/12, Mike Richardson <mike-1gTsUfBLqWsG2Il/[email protected]>: >=20 > On Tuesday 30 August 2005 15:40, Ernesto Revilla wrote: > > Hello. > > > > I have the typical parent-child form for invoices (or orders)=20 > introducing > > article lines with quantity, price and total amount. At the bottom of= =20 > the > > form a box should display the total amount of the invoice. This is > > calculated using a trigger inside the postgresql database. > > > > There is no refresh operation I can call from python, in the post-sync > > event. I think that a requery operation won't do it, because it=20 > re-executes > > the query for the main form, will reset the focus, eventually jump to > > another record and do a lot of extra work that I don't need. I just wan= t=20 > to > > re-read the data for the current record of the main form. (excactly the > > operation that is done after record insertion or update). > > > > How could this be accomplished ? >=20 > My first thought would be, can you separate the total amount field out=20 > into > another subblock with its own query, such that is shows the right value,= =20 > and > reload just that block when needed? >=20 > The last resort, though, would be to do the right SQL query "by hand", > something like: >=20 > def eventFunc (thing, ....) : >=20 > import RekallPYDBI > c =3D RekallPYDBI.connect (thing, '').cursor() > c.execute ('select .......') > d =3D c.fetchone() > thing.getNamedCtrl('path/to/control').setValue(row, d[0]) >=20 > The total amoutn field would be named but not have an expression >=20 > -- > Regards > Mike >=20 > http://www.rekallrevealed.org > *THE* GPL/Open Source database front end for Linux and Windows. >=20 > ------=_Part_3597_10431133.1126543241169 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Good evening,<br> <br> Putting these fields into a separate subblock could do it, although I think it's not a very nice solution, because it's making the design more complicate.<br> <br> I would prefer to implement a refresh option which could be called from Python. (MS-Access has this.) Do I have a way the mark a record as "dirty", i.e. modified, from Python? Do I have a way to force a &= quot;save record" operation? This is because, the save record operation, does automatically re-read the record from the database. So all the infrastructure is present. Perhaps I would just need a python binding. (In this case, could you give me some tips (filenames) where to look for it?) I would try to send a patch.<br> <br> Best regards, Erny<br> <br> <br><br><div><span class=3D"gmail_quote">2005/9/12, Mike Richardson <<a = href=3D"mailto:mike-1gTsUfBLqWsG2Il/[email protected]">mike-1gTsUfBLqWsG2Il/[email protected]</a>>:<= /span><blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb= (204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> On Tuesday 30 August 2005 15:40, Ernesto Revilla wrote:<br>> Hello.<br>&= gt;<br>> I have the typical parent-child form for invoices (or orders) i= ntroducing<br>> article lines with quantity, price and total amount. At = the bottom of the <br>> form a box should display the total amount of the invoice. This is= <br>> calculated using a trigger inside the postgresql database.<br>>= <br>> There is no refresh operation I can call from python, in the post-= sync <br>> event. I think that a requery operation won't do it, because it re= -executes<br>> the query for the main form, will reset the focus, eventu= ally jump to<br>> another record and do a lot of extra work that I don't= need. I just want to <br>> re-read the data for the current record of the main form. (excactl= y the<br>> operation that is done after record insertion or update).<br>= ><br>> How could this be accomplished ?<br><br>My first thought would= be, can you separate the total amount field out into <br>another subblock with its own query, such that is shows the right value= , and<br>reload just that block when needed?<br><br>The last resort, though= , would be to do the right SQL query "by hand",<br>something like= : <br><br>def eventFunc (thing, ....) :<br><br> import= RekallPYDBI<br> c =3D RekallPYDBI.connect (thing, '= ').cursor()<br> c.execute ('select .......')<br>&nbs= p; d =3D c.fetchone()<br> thing.get= NamedCtrl('path/to/control').setValue(row, d[0]) <br><br>The total amoutn field would be named but not have an expression<br= ><br>--<br>Regards<br>Mike<br><br><a href=3D"http://www.rekallrevealed.org"= >http://www.rekallrevealed.org</a><br>*THE* GPL/Open Source database front = end for Linux and Windows. <br><br></blockquote></div><br> ------=_Part_3597_10431133.1126543241169-- --===============0869794744== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Rekall-devel mailing list [email protected] http://www.mailman.a-i-s.co.uk/cgi-bin/mailman/listinfo/rekall-devel --===============0869794744==--