Re: django sqlite autoincrement bug

2009-02-02 Thread Malcolm Tredinnick
On Mon, 2009-02-02 at 23:16 -0500, alexander lind wrote: > > On Feb 2, 2009, at 10:05 PM, Malcolm Tredinnick wrote: > > > I always make my auto-inc fields primary as well, so no argument > > > there. > > > I tried using the AutoField when I noticed django didn't create > > > the > > >

Re: django sqlite autoincrement bug

2009-02-02 Thread alexander lind
On Feb 2, 2009, at 10:05 PM, Malcolm Tredinnick wrote: >> I always make my auto-inc fields primary as well, so no argument >> there. >> I tried using the AutoField when I noticed django didn't create the >> auto-incrementing fields correctly by itself in sqlite, but that >> didn't work either

Re: django sqlite autoincrement bug

2009-02-02 Thread Malcolm Tredinnick
On Mon, 2009-02-02 at 09:42 -0500, alexander lind wrote: > >>> Shows how infrequently AutoField's are really used in practice. > >>> They're > >>> generally just not that useful to specify. > >> > >> > >> What else do people use for specifying autoinc fields? > > > > Auto-increment fields

Re: django sqlite autoincrement bug

2009-02-02 Thread alexander lind
>>> Shows how infrequently AutoField's are really used in practice. >>> They're >>> generally just not that useful to specify. >> >> >> What else do people use for specifying autoinc fields? > > Auto-increment fields generally aren't that useful in practice, > outside > of primary keys (the

Re: django sqlite autoincrement bug

2009-02-01 Thread Malcolm Tredinnick
On Sat, 2009-01-31 at 16:56 -0500, alexander lind wrote: > > > > > > > class User(models.Model): > > > user_id = models.AutoField(primary_key=True) > > > > > > This produces a table in sqlite that will NOT take NULL for a > > > value > > > when inserting records. You get an error back. > >

Re: django sqlite autoincrement bug

2009-01-31 Thread alexander lind
>> Anyway, if you you'd like to fix your patch to always do this for the >> SQLite backend, that would be great (it looks like a one-line patch >> to >> django/db/backends/sqlite/creation.py). > > I don't see a simple way to make this happen. Doesn't seem like any > other backend DB requires

Re: django sqlite autoincrement bug

2009-01-31 Thread alexander lind
> >> Reading sqlites manual, >> this is _supposed_ to work, but doesn't seem to. However and >> furthermore, you don't really get autoincrement behavior from sqlite >> unless you add in the SQL keyword "AUTOINCREMENT" when creating the >> table. >> >> Django does not do this currently, so I

Re: django sqlite autoincrement bug

2009-01-31 Thread alexander lind
>> >> class User(models.Model): >> user_id = >> models.AutoField(primary_key=True) >> >> This produces a table in sqlite that will NOT take NULL for a value >> when inserting records. You get an error back. > > That's correct behaviour. A primary key

Re: django sqlite autoincrement bug

2009-01-30 Thread Malcolm Tredinnick
On Fri, 2009-01-30 at 22:37 -0500, alexander lind wrote: > I am using the svn trunk version of Django. > > I was just starting a new django project using sqlite for the db > backend. Excerpt from models.py: > > class User(models.Model): > user_id =