"Do Django models support multiple-column primary keys?
"No. Only single-column primary keys are supported."
Temporary Half-Fix
Currently, I have primary_key=True set on the reward_num column within the Django model, in order to have the "Quests" page on the Django administration interface displaying at all:
However, edits to quest rewards likely fail with various 500-level error codes at this time.
Solution
I am still not sure of the right move here, but I suspect that our best option may be to copy the way that "quest_steps" works - since there is a primary key of step_id.
Problem
In order to administrate "Quest Rewards" from the Django administration interface, the
quest_rewards
table needs a new primary key column.I actually removed the primary key definition on the
ishar_test
.quest_rewards
MySQL table, just to see if it made a difference:Cause
However, it turns out, "only single-column primary keys are supported" within Django...
https://docs.djangoproject.com/en/dev/faq/models/#do-django-models-support-multiple-column-primary-keys
Temporary Half-Fix
Currently, I have
primary_key=True
set on thereward_num
column within the Django model, in order to have the "Quests" page on the Django administration interface displaying at all:https://github.com/IsharMud/ishar-web/blob/django/ishar/apps/quest/models/reward.py#L15
However, edits to quest rewards likely fail with various 500-level error codes at this time.
Solution
I am still not sure of the right move here, but I suspect that our best option may be to copy the way that "
quest_steps
" works - since there is a primary key ofstep_id
.https://github.com/IsharMud/ishar-web/blob/django/ishar/apps/quest/models/step.py
As far as I am aware, management of Quest Steps does indeed work properly and correctly in the Django administration interface.