Re: Django, MySQL - bug?

2009-07-20 Thread Tomasz Zieliński
I tried this: import MySQLdb db = MySQLdb.connect(...) c = db.cursor() c.execute("create table mtest (pk int not null auto_increment primary key, s varchar(5)) type=InnoDB") print c.execute("insert into mtest values (null,'12345')") print c.messages print c.lastrowid print c.execute("insert

Re: Django, MySQL - bug?

2009-07-19 Thread Tomasz Zieliński
On 19 Lip, 18:32, Alex Gaynor wrote: > 2009/7/19 Tomasz Zieliński : > > > > > > > On 19 Lip, 16:29, Joshua Russo wrote: > >> 2009/7/19 Tomasz Zieliński > > >> > So, should

Re: Django, MySQL - bug?

2009-07-19 Thread Alex Gaynor
2009/7/19 Tomasz Zieliński : > > > > On 19 Lip, 16:29, Joshua Russo wrote: >> 2009/7/19 Tomasz Zieliński >> >> > So, should m.save() set m.id to some other value than None >> > or this is relaxed when

Re: Django, MySQL - bug?

2009-07-19 Thread Tomasz Zieliński
On 19 Lip, 16:29, Joshua Russo wrote: > 2009/7/19 Tomasz Zieliński > > > So, should m.save() set m.id to some other value than None > > or this is relaxed when Warning exception is thrown? > > It's the database that gives m.id a value

Re: Django, MySQL - bug?

2009-07-19 Thread Joshua Russo
2009/7/19 Tomasz Zieliński > So, should m.save() set m.id to some other value than None > or this is relaxed when Warning exception is thrown? It's the database that gives m.id a value upon a valid save. So because the record couldn't be saved it never

Re: Django, MySQL - bug?

2009-07-19 Thread Tomasz Zieliński
On 19 Lip, 10:35, Daniel Roseman wrote: > > I don't know why you think it's a bug. Django's models are - by design > - not an instantaneous reflection of the database. Rather, they only > interact with the DB when you load and save them. So this is the > expected

Re: Django, MySQL - bug?

2009-07-19 Thread Daniel Roseman
On Jul 18, 10:39 pm, Tomasz Zieliński wrote: > I prepared following repro case, just paste to models.py to an empty > project: > > --- > from MySQLdb import Warning as Warning > from django.db import models

Django, MySQL - bug?

2009-07-18 Thread Tomasz Zieliński
I prepared following repro case, just paste to models.py to an empty project: --- from MySQLdb import Warning as Warning from django.db import models import unittest class TestModel(models.Model): char_field =