django-categories
django-categories copied to clipboard
Not seeing category fields in admin?
I installed (pip) django-categories today, and added a field in my model:
categories = models.ManyToManyField('categories.Category', blank=True, null=True)
before running syncdb
.
I have Categories in my admin, and I'm not seeing any file errors for treeTable or expand/collapse files, but I'm only seeing 1 level deep:
http://www.circa1977.net/snap/admin-categories.png
In the source for the page, I can see the child rows, but they don't show in the admin. Nor does a expand/collapse toggle.
The following doesn't seem to be true, either. I'm using fieldsets, and the categories field only shows up if I include it in the fieldsets in my ModelAdmin.
https://django-categories.readthedocs.org/en/latest/admin_settings.html
I'm using Django 1.6.
Should I be seeing something else in the admin? How do I enable the treeview + checkboxes described in the docs?
Thanks!
Mark
I do have categories.editor
installed as well.
Django 1.6 includes jQuery 1.9.1 in the admin. It looks like treeTable.js needs to be updated in django-categories to be compatible.
I'm currently working on trying to get jQueryMigrate included.
I've overridden change_list.html
to try jQueryMigrate or specify jQuery 1.8.3 to no avail. Something in treeTable.js just isn't enhancing the table. I can force expanded view within the tree_editor.html
template and see all the rows, but the expand/collapse toggles are never revealed.
This was purely an issue with how treeTable.js and treeTable.css are working. Specifically, line 427 of treeTable.js needed the negative margin-left
inline style removed. I then tweaked column & .expanded
width values in treeTable.css to see things properly.
The simple fix:
Put: .treeTable td:nth-of-type(1) { padding-left: 21px; padding-right: 10px; }
in: editor/static/editor/jquery.treeTable.css