On Jan 9, 2011, at 4:13 PM, Carey Gagnon wrote:
> Everything fires correctly in this validation method except the first one:
>
> if self.Record.type == 0:
> msgs.append("You must select a project extra type")
>
>
> It allows me to save even if type equals 0
>
> Does this have something to do with the fact that my choice and key are in
> the cdxml file as opposed to creating a method to populate choice and keys
> in my -code.py file?
Yes, since if you look at the definition for Keys, the values are
strings:
Keys="[u'0', u'DC', u'DEX']"
You should change your test to compare with "0".
Another (unrelated) suggestion: don't use reserved words such as 'type'
as column names (or any other names, for that matter). It can cause all sorts
of hard-to-detect bugs.
-- Ed Leafe
_______________________________________________
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]