| | 366 | Do Django models support multiple-column primary keys? |
|---|
| | 367 | ------------------------------------------------------ |
|---|
| | 368 | |
|---|
| | 369 | No. Only single-column primary keys are supported. |
|---|
| | 370 | |
|---|
| | 371 | But this isn't an issue in practice, because there's nothing stopping you from |
|---|
| | 372 | adding other constraints (using the ``unique_together`` model option or |
|---|
| | 373 | creating the constraint directly in your database), and enforcing the |
|---|
| | 374 | uniqueness at that level. Single-column primary keys are needed for things such |
|---|
| | 375 | as the admin interface to work; e.g., you need a simple way of being able to |
|---|
| | 376 | specify an object to edit or delete. |
|---|
| | 377 | |
|---|