Noxxan
unread,Nov 18, 2011, 10:47:18 AM11/18/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
Hi,
I have a problem with large form in Django admin site. I have a model
A with two inline models (B and C). Model B have some fields, and one
of them is ForeignKey with another model (we can call it D). This
field is displayed as HTML select field and have a lot of options
(about 2k).
I have record in model A. In it there is about 20 related records in
model B, and so my HTML code has about 50k lines of code (mainly
because of HTML select with model D).
The problem is that sometimes (it happens yesterday first time) some
of ForeignKey values in model B changes without user interaction, user
changed something else in this big form and clicked "submit" button.
Situation looks like that:
Model B records (ID means ForeignKey ID):
ID before submit -> ID after submit
1 -> 182
2 -> 700
3 -> 3 (no diff)
1 -> 182
2 -> 700
5 -> 5
6 -> 6
2 -> 700
...etc
So, some of foreign keys changes, some not. But also when in one
record foreign key ID was changed to some value, in other record with
the same value before, value after was changed to the same value as in
other records with this "before foreign key ID".
No errors was raised there, and Django logged changes in admin log
that this fields was changed there (so, it looks like the user changed
that fields, but I'm 100% sure that user doesnt do that).
What could be a problem?
Thanks