Author: reinhard Date: 2010-05-12 10:19:31 -0500 (Wed, 12 May 2010) New Revision: 10182
Modified: trunk/gnue-forms/ trunk/gnue-forms/src/GFObjects/GFField.py trunk/gnue-forms/src/GFParser.py Log: Added option to make foreign key lookup case sensitive. Property changes on: trunk/gnue-forms ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2010-04-26 10:35:00.467000008 +0200 committer: Reinhard Müller <reinhard.muel...@bytewise.at> properties: branch-nick: forms + timestamp: 2010-05-12 17:17:44.903000116 +0200 committer: Reinhard Müller <reinhard.muel...@bytewise.at> properties: branch-nick: forms Name: bzr:file-ids - po/el.po 9...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-forms:po%2Fel.po + src/GFObjects/GFField.py 1...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-forms:src%2FGFObjects%2FGFField.py src/GFParser.py 1...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-forms:src%2FGFParser.py Name: bzr:revision-id:v4 - 3116 reinhard.muel...@bytewise.at-20100426083500-vtmq0qvd7htz02zx + 3116 reinhard.muel...@bytewise.at-20100426083500-vtmq0qvd7htz02zx 3117 reinhard.muel...@bytewise.at-20100512151744-2jx8tmtop30kl5n0 Name: bzr:text-parents - po/el.po svn-v3-single1-dHJ1bmsvZ251ZS1mb3Jtcw..:3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-forms:10047 + src/GFObjects/GFField.py svn-v3-single1-dHJ1bmsvZ251ZS1mb3Jtcw..:3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-forms:10149 src/GFParser.py svn-v3-single1-dHJ1bmsvZ251ZS1mb3Jtcw..:3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-forms:10013 Modified: trunk/gnue-forms/src/GFObjects/GFField.py =================================================================== --- trunk/gnue-forms/src/GFObjects/GFField.py 2010-05-05 09:31:16 UTC (rev 10181) +++ trunk/gnue-forms/src/GFObjects/GFField.py 2010-05-12 15:19:31 UTC (rev 10182) @@ -74,6 +74,7 @@ self.__lookup_list = [u""] # all valid user values self.__lookup_dict = None # {db_value: user_value} self.__lookup_dict_reverse = {} # {user_value: db_value} + self.lookup_ignorecase = True # Autoquery support self.__autoquery_value = None @@ -334,8 +335,12 @@ return (value, cursor) for allowed in self.__lookup_list: - if allowed.upper().startswith(value.upper()): - return (allowed, cursor) + if self.lookup_ignorecase: + if allowed.upper().startswith(value.upper()): + return (allowed, cursor) + else: + if allowed.startswith(value): + return (allowed, cursor) # Nothing found, return original user input. return (value, cursor) Modified: trunk/gnue-forms/src/GFParser.py =================================================================== --- trunk/gnue-forms/src/GFParser.py 2010-05-05 09:31:16 UTC (rev 10181) +++ trunk/gnue-forms/src/GFParser.py 2010-05-12 15:19:31 UTC (rev 10182) @@ -616,6 +616,12 @@ 'Default': 'startup', 'Description': 'Decides when the foreign key should be ' 'refreshed.' }, + 'lookup_ignorecase': { + 'Label': u_("Ignore case for lookup"), + 'Description': u_( + "If set, lookup will be case insensitive."), + 'Typecast': GTypecast.boolean, + 'Default': True}, 'default': { 'Typecast': GTypecast.text, 'Label': _('Default (New Records)'), _______________________________________________ commit-gnue mailing list commit-gnue@gnu.org http://lists.gnu.org/mailman/listinfo/commit-gnue