On 2019-08-08 10:47:47 -0700, Rich Shepard wrote: > On Thu, 8 Aug 2019, Adrian Klaver wrote: > > Unfortunately it does not: > > https://code.djangoproject.com/wiki/MultipleColumnPrimaryKeys > > > > Given that the issue: > > https://code.djangoproject.com/ticket/373 > > is 14 years old does not inspire confidence that it will change anytime soon. > > Adrian, > > That's really interesting. I don't see how a framework cannot implement > multi-column PKs. You are a database guy. You have a database and want to write an application for it. Even in a greenfield project, you probably do the database design first. (I know I do) The Django framwork comes from the opposite direction. The programmers aren't expected to know much about relational databases[1]. They are expected to write their application and Django provides (among other things like session and form handling) a persitence layer which happens to be backed by a relational database. So Django's ORM layer isn't intended to deal with any possible (or even any reasonable) database model - just with database models generated by Django. Django lets you use "unmanaged" tables, but it is quite noticeable that this isn't the primary use case. > Many databases I have include tables for samples (geochemical, biological, > physical) where the PK for each row is location, date, parameter. Good thing > I don't like browser user interfaces, eh? :-) Django isn't the only web framework. hp [1] It should be noted, however, that the Django ORM is what Joel Spolsky calls a leaky abstraction. If you are ignorant about how RDBMSs work, your application will probably be horrendously slow. Even if you do know this, you often have to bend over backwards to get reasonable performance. -- _ | Peter J. Holzer | we build much bigger, better disasters now |_|_) | | because we have much more sophisticated | | | hjp@xxxxxx | management tools. __/ | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/>
Attachment:
signature.asc
Description: PGP signature