On Jan 9, 1:48 pm, Michael Bayer <mike...@zzzcomputing.com> wrote:
> Still not seeing how that would make a difference if that's fully what's 
> going on.  What is the value of "invite_code.used" after the assignment ?   
> Does loading "invite_code.used" change the result of the output ?  Can you 
> test "assert invite_code in elixir.session" ?

If I insert print statements before and after the assignment, it shows
that it correctly increments invite_code.used by 1. So, if before is 1
after is 2, etc. Not sure what you meant by loading invite_code.used,
but I was printing it after the assignment (and it prints the
correctly updated value). assert invite_code in elixir.session is True

Here's a link [http://linux.ucla.edu/~bsack/dbtest.tgz] to a self-
contained test that requires elixir and a single row in the
invite_codes table, and produces the following output on my machine:

r...@dev-01:~$ ./dbtest.py
elixir: 0.7.1
sqlalchemy: 0.6.4
{'code': '1234567', 'email': 'a...@b.com', 'used': 8L, 'created_by_id':
30L, 'total': 1L, 'id': 1L}
before: 8
after: 9
Email already in use. Rolling back.


Afterwards, the database used value stays updated at 9, and will get
incremented every time I run.

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to