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 = Lesson_line.objects.filter(lesson=id)
> lng = line.lesson.language
> spkwords = line.sentencespk.split()
> for wrd in spkwords:
> try:
> wd = wrd.strip('!.,?')
> w = Word(word=wd,written=False,
> language=lng)
> w.save()
> except:
> pass
> wrtwords = line.sentencewrt.split()
> for wrd in wrtwords:
> try:
> wd = wrd.strip('!.,?')
>
> w = Word(word=wd,written=True,
> language=lng)
> w.save()
> except:
> pass
> t = loader.get_template("web/updated.html")
> c=Context({'request':request})
> return HttpResponse(t.render(c))
this loop above does not work. However, when I remove the loop and do
it one Lesson_line at a time, it works
--
regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/web/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---