On Thu, Oct 2, 2008 at 2:21 PM, Eric <[EMAIL PROTECTED]> wrote:
> On Oct 2, 4:51 pm, Ludvig Ericson <[EMAIL PROTECTED]> wrote:
>> On Oct 2, 2008, at 10:31, Eric wrote:
>> > Hi,
>> > I saw few questions from people who wonder how to manage tables
>> > without primary key (when using inspectdb on a legacy db);
>> > A great hope is born: I just discovered that this problem could be
>> > adressed, at least it works with sqlite:
>>
>> > just add this field (rowid or oid is the sqlite automatic pk) in the
>> > model:
>>
>> >    rowid = models.IntegerField(primary_key=True, editable=False)
>>
>> > It works ! it's so simple ! I love django !
>>
>> > Maybe this tip could be added in the doc; for others sgbd, there must
>> > be something similar.
>> > And why not put this in the inspectdb command ...
>>
>> Because it's a dirty, dirty hack.
> It is your opinion; what is your solution ? it should interest me,
> because this "dirty hack" can only work with sqlite, oracle (and
> postgres 8+ with a special configuration), but not with mysql.

I would be surprised if it works with Oracle, unless you replace
IntegerField with CharField(max_length=18).

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

Reply via email to