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
> > > auto-inc
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 unt
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 generall
>>> 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 reas
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.
> >
>> 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 sim
>
>> 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 hacked
>>
>> 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 colu
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 =
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 =
models.AutoField(primary_key=True)
This produces a table in sqlite t
10 matches
Mail list logo