Friday, December 30, 2011

Re: model for legacy table without primary key

On Dec 30, 7:53 pm, Bill Beal <b.b...@eximflow.com> wrote:
> But it can't be a primary key if the values are not unique, right?
> The four fields are unique together, but not necessarily individually.

It is not a real primary key. The idea is to tell Django it is a
primary key even if it is not. And hope everything works OK (should
work for most SELECT queries).

So, it is just an ugly hack. Do not try this with writing queries,
data corruption is guaranteed :)

- Anssi

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

No comments:

Post a Comment