git://git.onelab.eu
/
plstackapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
34b502f
)
cleaner version of selector
author
Scott Baker
<smbaker@gmail.com>
Wed, 6 Aug 2014 01:52:14 +0000
(18:52 -0700)
committer
Scott Baker
<smbaker@gmail.com>
Wed, 6 Aug 2014 01:52:14 +0000
(18:52 -0700)
planetstack/core/admin.py
patch
|
blob
|
history
diff --git
a/planetstack/core/admin.py
b/planetstack/core/admin.py
index
86b2b3c
..
9f8fbb0
100644
(file)
--- a/
planetstack/core/admin.py
+++ b/
planetstack/core/admin.py
@@
-239,7
+239,7
@@
class SliverInline(PlStackTabularInline):
# then find the child with class "field-node"
# then find the child with that is a select
# then return its id
# then find the child with class "field-node"
# then find the child with that is a select
# then return its id
- kwargs['widget'] = forms.Select(attrs={'onChange': "update_nodes(this, $($(
$(this).closest('tr')[0]).children('.field-node')[0]).children('select')[0].id);
"})
+ kwargs['widget'] = forms.Select(attrs={'onChange': "update_nodes(this, $($(
this).closest('tr')[0]).find('.field-node select')[0].id)
"})
#kwargs['widget'] = forms.Select(attrs={'onChange': "console.log($($($(this).closest('tr')[0]).children('.field-node')[0]).children('select')[0].id);"})
field = super(SliverInline, self).formfield_for_foreignkey(db_field, request, **kwargs)
#kwargs['widget'] = forms.Select(attrs={'onChange': "console.log($($($(this).closest('tr')[0]).children('.field-node')[0]).children('select')[0].id);"})
field = super(SliverInline, self).formfield_for_foreignkey(db_field, request, **kwargs)