From: Alex T. <al...@tw...> - 2005-07-24 12:42:57
|
Lucas VERGNETTES wrote: > Hi, > > I'm enjoying a lot using PythonCard, and I'm extending the > gadflyDatabase example for fun. > > One thing I would like to do is to be able to display the 'ID' number > that gadfly uses in the database. > I don't think I can access it with self.components.id .... or with an > SQL query (how to be sure to get the good number when creating a new > card?) > > > Thanks for your help, I will post sniplets of code if needed. I've not used Gadfly, but assuming it's similar to other SQL databases (which I also haven't used much :-), .... once the database entry has been created, you should be able to retrieve all its fields, including the id, with an SQL statement. I'd look some more at SQL tutorials to try to find how to do this. Then, the id would be just another field to be filled in: self.components.id.text = str(self._row[0]) self.components.name.text = self._row[1] etc. -- Alex Tweedly http://www.tweedly.net -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.338 / Virus Database: 267.9.4/57 - Release Date: 22/07/2005 |