django-funky-sheets
django-funky-sheets copied to clipboard
Error with ForeignKey fields position
The position of the foreignkey field in the fields tuple is not flexible. current situation (in the example) only works with the first foreignkey field on the t position. This works:
fields = (
'id',
'title',
'director', <-- FK
'country', <-- FK
'parents_guide',
'imdb_rating',
'genre',
'imdb_link',
)
This gives a javascript error:
fields = (
'id',
'title',
'imdb_rating',
'director', <-- FK
'country', <-- FK
'parents_guide',
'genre',
'imdb_link',
)
This gives also a javascript error:
fields = (
'id',
'title',
'director', #<-- FK
'imdb_rating',
'country', #<--FK
'parents_guide',
'imdb_rating',
'genre',
'imdb_link',
)
This gives a form validation error:
fields = (
'id',
'director',
'country',
'title',
'imdb_rating',
'parents_guide',
'imdb_rating',
'genre',
'imdb_link',
)
I have same problem. Please let me know if you have any solution.
@Nielssie @mailtodaman Unfortunately I don't have time to work on this package. It could take me a month or two to get back on track here. If any of you wants to collaborate on it, I'll definitely consider potential PRs.
@trco No worries. I have a (dirty) workaround: I build up the javascript variable columns in django: var columns = {{ columns|handsomtable|safe }} and the validation error is a javascript error in the switch function in case of a select, it was:
var index = fieldType[j][1].indexOf(value);
value = fieldType[j][0][index];
it should be:
var index = fieldType[1][1].indexOf(value_index);
value = fieldType[1][0][index];
Thanks for your reply. I tried it without any success.