-
Notifications
You must be signed in to change notification settings - Fork 703
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
django-mptt tree sortable #146
Comments
Please post which version of |
Django==1.5.2 Thanks for such a quick response |
Check browser debug console, and see if you haven't any javascript errors or static files missing. |
I'm running it locally with debug=True Just used Firefox.
|
To investigate further i will resulting html source for whole page, i tested using same versions and same classes and it worked for me. |
Do you want me to copy the sourcecode of the page, here? |
Use some http://dpaste.com/ site and post the link with the resulting html source. |
Just noticed you changed previous answer adding these JS errors. |
No errors on Chrome. Just Firefox. |
Having the same issue using the example from the doc (I'm using the same version as Mishbah). It looks like the HTML classes defined on the order widget by SortableModelAdmin are getting lost when the form class used is changed. So if you take the following examples: # This works fine.
class CategoryAdmin(SortableModelAdmin):
mptt_level_indent = 20
list_display = ('name', ) # This works fine too.
from django import forms
class CategoryAdmin(SortableModelAdmin):
mptt_level_indent = 20
list_display = ('name', )
form = forms.ModelForm # This does not.
from django import forms
class CustomForm(forms.ModelForm):
pass
class CategoryAdmin(SortableModelAdmin):
mptt_level_indent = 20
list_display = ('name', )
form = CustomForm Since MPTTModelAdmin modifies the form attribute, it breaks SortableModelAdmin. The resulting HTML for the input is: <input class="vIntegerField" id="id_form-0-order" name="form-0-order"
value="1" type="text"> Just for the sake of testing, I tried redefining the widget as such: from django import forms
class CustomForm(forms.ModelForm):
class Meta:
widgets = {
'order': forms.TextInput(
attrs={'class': 'hide input-mini suit-sortable'})
}
class CategoryAdmin(SortableModelAdmin):
mptt_level_indent = 20
list_display = ('name', )
form = CustomForm To not available. |
There is a possiblity this issue is related to recent changes in chis commit: 12e517f |
Tried 0.2.3, and that fixes the issue. I also tried again with 0.2.4, but reverting the changes you mentioned in 12e517f, and that works too. |
Ok, it means we found the problem. Thanks. |
Good. Thanks for you help. |
Thanks for all your help guys! Really appreciated. |
Could you please check latest
|
I tried to follow the doc example for django-mptt tree sortable
model.py
admin.py
But its not being displayed correctly in django admin
Please Help
[django-suit==0.2.4]
The text was updated successfully, but these errors were encountered: