list of foreignkey with concrete value
In order to get my groove on with Django, I'm giving myself a small and
fun challenge to build a common RPG character sheet.
Everything is going smoothly, but I'm looking at my code and it cries for
optimization. There's some of it that I can't pinpoint the best way to do
it and this is why I'm requesting your help about it.
The point is, what would be the best way to save the user skills. In my
opinion, there's 3 ways to do it :
1) Every skill is part of the sheet model. In this way, every skill is a
field for the model. If I want to change the skills, I need to update the
structure of my model, which I consider bad.
2) One model for the sheets, one model for the Skills and one mashup model
This way externalize the skill list from the sheet model, which is good,
but I have to access a third model to get the specific value of the sheet,
which tells me it could be improved
3) One model for the sheet with a list of reference of skills model and a
concrete value I don't even know if it is possible to do it, but it just
seems right to me to be working that way. 2 Models, each for every objects
that could exist individually. This way, in my sheet model, I could ask to
give me the skill level of "Climbing" and it could answer me a concrete
answer stored inside the model (being 5 for instance).
What's your thought about it? Can that be done? How? Do you have any other
idea on the subject? A better solution?
No comments:
Post a Comment