Hi all,
I'm new to Dabo and have been working with an AppWizard app just to figure
out how everything works. I have a couple questions that I haven't been
able to figure out. Anyone have any pointers? Sorry if these are trivial
questions.
(1) validateRecord
As long as some field of the new record has content, the validateRecord
method fires and performs as I would expect. However, if the record is
entirely empty, the validateRecord function does not fire. The record
appears to save successfully, though on the next requery it disappears so
clearly the record was not actually saved. How can I get the validateRecord
function to fire? I used the code from the tutorial to set up my
validateRecord and validateField functions.
def validateField(self, fld, val):
return "" ## validateRecord is better
def validateRecord(self):
msgs = []
if (self.Record.fname=="" or self.Record.lname==""):
msgs.append("An author must have a name.")
if msgs:
return "The author '%s' could not be saved because:\n" \
% self.Record.fname.strip() + "\n".join(msgs)
return "" # all ok
(2) new record creation
When I create a new record while on the Browse page the new record is
initiated with the value from the selected field in the browse page. That
is, if I have the name field of a record selected on the Browse page, the
new record is created with that name value. If I create a new record while
on the Search or Edit page, this does hot happen. How can I keep the new
record from having a default value when it's created from the browse page?
--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---
_______________________________________________
Post Messages to: [email protected]
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/[email protected]