Greg wrote:

> Norman,
> I added those print statements and ran the script.  The output was
> this over and over again:
> 
> ///
> 
> current transaction is aborted, commands ignored until end of
> transaction block
> 
> //
> 
> Any suggestions?

It sounds like some other exception is, sadly, being masked by the 
transaction abort exception.

Unless you know and like to use debuggers, the answer is almost always 
more print statements :)

I suspect that the file you are reading isn't properly formated csv, or 
the data in row[0] or row[1] aren't what your database expects, or some 
other error like that.

What you need to do is figure out what is actually being sent into 
OrderEmail and why that is causing database to choke and rollback.

   for row in reader:
        try:
            print row
            print row[0], row[1]
            b = OrderEmail(name=row[0], email=row[1], been_sent="0")
            b.save()
            print "saved", row
        except Exception, msg:
            print msg


I have no idea what OrderEmail is about but this
    been_sent="0"
looks suspicious.  Booleans, which been_sent certainly sounds like, in 
Python use True/False not 1/0 and esp not strings "0".  Try
    been_sent=False


-- 
Norman J. Harman Jr.  512 912-5939
Technology Solutions Group, Austin American-Statesman
___________________________________________________________________________
Get out and about this spring with the Statesman! In print and online,
the Statesman has the area's Best Bets and recreation events.
Pick up your copy today or go to statesman.com 24/7.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to