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
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"
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:
>
>
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:
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:
>
>
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
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 =
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
8 matches
Mail list logo