[dabo-users] Warning Python noob needs help

Author: Carey Gagnon

Posted: 2009-12-29 at 23:12:34

I first want to say thanks for the wonderful framework. It has allowed me to

achieve a small program needed to help track something with my job duties,

with next to nil programming experience.

That said, I need some help achieving the following, if it's even possible.

Please note that this works fine as is but I would like to add/pull one

piece of info into this info dialog box to make it easier on the end user.

After successfully adding a new record to the database, I let the user know

with the following:

def afterSave(self):

# This will only get called if the save succeeds

dabo.ui.info("Record successfully saved.", title="Success")

self.new()

self.BuilderName.setFocus()

As the MySQL auto increment number is used as a number that gets put on

accompanying paper work I would like to extend the message to include the

last inserted ID.

I read this thread on *getLastInsertID *

http://old.nabble.com/form.cancel-on-a-PageFrame-form-td10014107.html#a10019778

* *but can wrap my head around getting it in the info dialog so I get

something like:*

*def afterSave(self):

# This will only get called if the save succeeds

dabo.ui.info("Record successfully saved. Your new number is DC10- ID OF

LAST INSERTED RECORD HERE ", title="Success")

self.new()

self.BuilderName.setFocus()

Just to make things even harder on myself if the ID is a single digit (ie:

1) it would need to have 2 zero's in front of it to give me 001

if it's 2 digits (ie: 12) it would have to have a single zero in front to

give me 012. And just give the last row ID if it's 3 digits (ie: 356)

We will never have anymore than 999 entries.

Any help that anyone can provide would be greatly appreciated.

Thank

Carey

--- StripMime Report -- processed MIME parts ---

multipart/alternative

text/plain (text body -- kept)

text/html

---

_______________________________________________

Post Messages to: Dabo-users@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

Searchable Archives: http://leafe.com/archives/search/dabo-users

This message: http://leafe.com/archives/byMID/a3fcd6c70912292012u521846d6y7d9fd5d431229c46@mail.gmail.com

©2009 Carey Gagnon