I am using django as a tool for editing data for a game I'm working on; but 
I have some pretty deeply-nested relationships, and I'm hitting some 
problems getting forms to work properly.

The setup:
I have a data structure for nodes in a map. Each map has many nodes; each 
node has many encounters; each encounter has many individual monster fights.

So the ownership I have set up is this:
Map
|-Node
||-Encounter
|||-Fight
|||-Fight
||-Encounter
|||-fight
|-Node
||-Encounter
|||-Fight
|||-Fight

...and so forth. I have tried setting up nested inline formsets (there are 
a couple examples online if you search them) and they worked fine to edit 
each encounter on each node on the map, but as soon as I tried turning the 
Encounter form into a nested inline formset (so a doubly-nested formset) I 
can SEE the data when I render the HTML, but when I try to submit the form 
data, I get a strange error in query.py when validating: line 115 (in 
version 1.6.0); self._result_cache isn't None, but it IS empty, so 
self._result_cache[k] is an invalid index.

The question:
I don't even know that I'm going about this the best way. So if I'm 
thinking about presenting my data all wrong, I welcome correction. If the 
means seems appropriate but I must be missing some check or other to ensure 
that I'm sending useable data.

I want to believe that there's a better way to handle this than hacking 
together two nested formsets, but I'm new enough at django and web 
frameworks that I'm not sure what my alternatives are.

I welcome any assistance that you folks can offer. Thank you.

-- Scott

(PS: I erroneously sent a partial message, for which I apologize.)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ce799a8d-6a07-4e43-b7d4-93c7dbd12323%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to