Re: error when trying to save unicode data

2007-10-02 Thread Kenneth Gonsalves
On 02-Oct-07, at 7:47 PM, Nis Jørgensen wrote: > > get_or_create with "defaults" does what you asked for originally - > though the person commenting in the ticket got the syntax wrong. I'll test it out again and revert -- regards kg http://lawgon.livejournal.com

Re: error when trying to save unicode data

2007-10-02 Thread Nis Jørgensen
Kenneth Gonsalves skrev: > On 02-Oct-07, at 6:21 PM, Nis Jørgensen wrote: > > >>> get_or_create, *only* using the value of 'word' in the query - if >>> created, then I do an update to set the other fields - otherwise I >>> leave it alone. >>> >> You could also use the "defaults"

Re: error when trying to save unicode data

2007-10-02 Thread Kenneth Gonsalves
On 02-Oct-07, at 6:21 PM, Nis Jørgensen wrote: >> get_or_create, *only* using the value of 'word' in the query - if >> created, then I do an update to set the other fields - otherwise I >> leave it alone. > You could also use the "defaults" argument to get_or_create: > >

Re: error when trying to save unicode data

2007-10-02 Thread Nis Jørgensen
Kenneth Gonsalves skrev: > > I now do > get_or_create, *only* using the value of 'word' in the query - if > created, then I do an update to set the other fields - otherwise I > leave it alone. You could also use the "defaults" argument to get_or_create:

Re: error when trying to save unicode data

2007-10-02 Thread Kenneth Gonsalves
On 02-Oct-07, at 2:46 PM, Nis Jørgensen wrote: >> improper formatting - but am unable to find out where exactly the >> formatting is improper. If I put this function in the 'save' method >> of the model - I get the same error. > > This is an instance of the problem described here: > >

Re: error when trying to save unicode data

2007-10-02 Thread Nis Jørgensen
Kenneth Gonsalves skrev: > hi, > > I have a view that takes a sentence in unicode from a database, > splits it into words and dumps those words in the Word table. The > 'word' in word table is unique, and it is expected that duplicates be > rejected, so I put 'save()' within a try-except

Re: error when trying to save unicode data

2007-09-29 Thread Kenneth Gonsalves
replying to my self On 29-Sep-07, at 12:07 PM, Kenneth Gonsalves wrote: > def lessontodict(request,id): > """ > After a lesson is approved, the words, both written and > spoken are > dumped into the word table > """ > line =

error when trying to save unicode data

2007-09-29 Thread Kenneth Gonsalves
hi, I have a view that takes a sentence in unicode from a database, splits it into words and dumps those words in the Word table. The 'word' in word table is unique, and it is expected that duplicates be rejected, so I put 'save()' within a try-except statement. If my view does one