Re: [Tutor] Handling 'None' (null) values when processing sqlite cursorresults

2010-07-14 Thread Alan Gauld
Monte Milanuk memila...@gmail.com wrote (104, None, u'Sylvester', None, u'Evans', None, u'527-9210 Proin Av.', u'Liberal', u'VT', u'24742', u'1-135-197-1139', u'vehicula.pellentes...@idmollis.edu', u'2010-07-13 22:52:50', u'2010-07-13 22:52:50') At first I was having fits as str.join() was

Re: [Tutor] Handling 'None' (null) values when processing sqlite cursorresults

2010-07-14 Thread Christian Witts
On 14/07/2010 14:32, Alan Gauld wrote: Monte Milanuk memila...@gmail.com wrote (104, None, u'Sylvester', None, u'Evans', None, u'527-9210 Proin Av.', u'Liberal', u'VT', u'24742', u'1-135-197-1139', u'vehicula.pellentes...@idmollis.edu', u'2010-07-13 22:52:50', u'2010-07-13 22:52:50') At

Re: [Tutor] Handling 'None' (null) values when processing sqlite cursorresults

2010-07-14 Thread Alan Gauld
Christian Witts cwi...@compuscan.co.za wrote You need a display function that can strip out the nulls as needed. A simple list comprehension or generator expression would work in this case: print ' '.join(str(field) for field in data if field is not 'None') The problem with that is if

Re: [Tutor] Handling 'None' (null) values when processing sqlite cursorresults

2010-07-14 Thread Monte Milanuk
On 7/14/10 5:32 AM, Alan Gauld wrote: The key principle is do not try to store your data in a display format. Never was my intention. I just hadn't anticipated needing to write my own function to handle something as (I would think) common as a NULL value in a database field. I had been

Re: [Tutor] Handling 'None' (null) values when processing sqlite cursorresults

2010-07-14 Thread Christian Witts
On 14/07/2010 19:34, Alan Gauld wrote: Christian Witts cwi...@compuscan.co.za wrote You need a display function that can strip out the nulls as needed. A simple list comprehension or generator expression would work in this case: print ' '.join(str(field) for field in data if field is not